Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge pull request #200 from Takishipp/clear_fct
[simgrid.git] / include / simgrid / forward.h
1 /* Copyright (c) 2004-2017. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #ifndef SIMGRID_TYPES_H
7 #define SIMGRID_TYPES_H
8
9 #ifdef __cplusplus
10
11 #include "s4u/forward.hpp"
12 #include "xbt/base.h"
13 #include <boost/intrusive_ptr.hpp>
14
15 namespace simgrid {
16 namespace kernel {
17 namespace context {
18 class Context;
19 class ContextFactory;
20 }
21 namespace activity {
22   class ActivityImpl;
23   using ActivityImplPtr = boost::intrusive_ptr<ActivityImpl>;
24   XBT_PUBLIC(void) intrusive_ptr_add_ref(ActivityImpl* activity);
25   XBT_PUBLIC(void) intrusive_ptr_release(ActivityImpl* activity);
26
27   class CommImpl;
28   using CommImplPtr = boost::intrusive_ptr<CommImpl>;
29   class ExecImpl;
30   using ExecImplPtr = boost::intrusive_ptr<ExecImpl>;
31   class IoImpl;
32   using IoImplPtr = boost::intrusive_ptr<IoImpl>;
33   class RawImpl;
34   using RawImplPtr = boost::intrusive_ptr<RawImpl>;
35   class SleepImpl;
36   using SleepImplPtr = boost::intrusive_ptr<SleepImpl>;
37
38   class MailboxImpl;
39 }
40
41 namespace routing {
42   class NetPoint;
43 }
44 }
45 namespace simix {
46   class ActorImpl;
47   using ActorImplPtr = boost::intrusive_ptr<ActorImpl>;
48   class Host;
49
50   class MutexImpl;
51 }
52 namespace surf {
53   class Resource;
54   class Cpu;
55   class LinkImpl;
56   class HostImpl;
57   class StorageImpl;
58   class FileImpl;
59 }
60 namespace trace_mgr {
61   class trace;
62   class future_evt_set;
63 }
64 }
65
66 typedef simgrid::s4u::Actor s4u_Actor;
67 typedef simgrid::s4u::Host s4u_Host;
68 typedef simgrid::s4u::Link s4u_Link;
69 typedef simgrid::s4u::File s4u_File;
70 typedef simgrid::s4u::Storage s4u_Storage;
71 typedef simgrid::s4u::NetZone s4u_NetZone;
72 typedef simgrid::s4u::VirtualMachine s4u_VM;
73 typedef boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> smx_activity_t;
74 typedef simgrid::kernel::routing::NetPoint routing_NetPoint;
75 typedef simgrid::surf::Resource surf_Resource;
76 typedef simgrid::trace_mgr::trace tmgr_Trace;
77
78 typedef simgrid::kernel::context::Context* smx_context_t;
79 typedef simgrid::simix::ActorImpl* smx_actor_t;
80 typedef simgrid::simix::MutexImpl* smx_mutex_t;
81 typedef simgrid::kernel::activity::MailboxImpl* smx_mailbox_t;
82 typedef simgrid::surf::FileImpl* surf_file_t;
83
84 #else
85
86 typedef struct s4u_Actor s4u_Actor;
87 typedef struct s4u_Host s4u_Host;
88 typedef struct s4u_Link s4u_Link;
89 typedef struct s4u_File s4u_File;
90 typedef struct s4u_Storage s4u_Storage;
91 typedef struct s4u_NetZone s4u_NetZone;
92 typedef struct s4u_VM s4u_VM;
93 typedef struct kernel_Activity* smx_activity_t;
94 typedef struct routing_NetPoint routing_NetPoint;
95 typedef struct surf_Resource surf_Resource;
96 typedef struct Trace tmgr_Trace;
97
98 typedef struct s_smx_context* smx_context_t;
99 typedef struct s_smx_actor* smx_actor_t;
100 typedef struct s_smx_mutex* smx_mutex_t;
101 typedef struct s_smx_mailbox* smx_mailbox_t;
102
103 #endif
104
105 typedef s4u_NetZone* sg_netzone_t;
106 typedef s4u_Host* sg_host_t;
107 typedef s4u_Link* sg_link_t;
108 typedef s4u_Storage* sg_storage_t;
109 typedef s4u_File* sg_file_t;
110 typedef s4u_VM* sg_vm_t;
111
112 typedef routing_NetPoint* sg_netpoint_t;
113 typedef surf_Resource *sg_resource_t;
114
115 typedef tmgr_Trace *tmgr_trace_t; /**< Opaque structure defining an availability trace */
116
117 typedef struct s_smx_simcall s_smx_simcall_t;
118 typedef struct s_smx_simcall* smx_simcall_t;
119
120 typedef enum {
121   SURF_LINK_FULLDUPLEX = 2,
122   SURF_LINK_SHARED = 1,
123   SURF_LINK_FATPIPE = 0
124 } e_surf_link_sharing_policy_t;
125
126 typedef enum {
127   SURF_TRACE_CONNECT_KIND_HOST_AVAIL = 4,
128   SURF_TRACE_CONNECT_KIND_SPEED = 3,
129   SURF_TRACE_CONNECT_KIND_LINK_AVAIL = 2,
130   SURF_TRACE_CONNECT_KIND_BANDWIDTH = 1,
131   SURF_TRACE_CONNECT_KIND_LATENCY = 0
132 } e_surf_trace_connect_kind_t;
133
134 typedef enum {
135   SURF_ACTOR_ON_FAILURE_DIE = 1,
136   SURF_ACTOR_ON_FAILURE_RESTART = 0
137 } e_surf_process_on_failure_t;
138
139
140 /** @ingroup m_datatypes_management_details
141  * @brief Type for any simgrid size
142  */
143 typedef unsigned long long sg_size_t;
144
145 /** @ingroup m_datatypes_management_details
146  * @brief Type for any simgrid offset
147  */
148 typedef long long sg_offset_t;
149
150 typedef unsigned long aid_t;
151
152 #endif /* SIMGRID_TYPES_H */