Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
607810d5d386f28225dd81d617be92b1b9728283
[simgrid.git] / include / simgrid / forward.h
1 /* Copyright (c) 2004-2020. 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 #include <xbt/base.h>
10
11 #ifdef __cplusplus
12
13 #include <boost/intrusive_ptr.hpp>
14
15 namespace simgrid {
16
17 namespace s4u {
18 class Activity;
19
20 class Actor;
21 /** Smart pointer to a simgrid::s4u::Actor */
22 typedef boost::intrusive_ptr<Actor> ActorPtr;
23 XBT_PUBLIC void intrusive_ptr_release(const Actor* actor);
24 XBT_PUBLIC void intrusive_ptr_add_ref(const Actor* actor);
25
26 class Barrier;
27 /** Smart pointer to a simgrid::s4u::Barrier */
28 typedef boost::intrusive_ptr<Barrier> BarrierPtr;
29 XBT_PUBLIC void intrusive_ptr_release(Barrier* m);
30 XBT_PUBLIC void intrusive_ptr_add_ref(Barrier* m);
31
32 class Comm;
33 /** Smart pointer to a simgrid::s4u::Comm */
34 typedef boost::intrusive_ptr<Comm> CommPtr;
35 XBT_PUBLIC void intrusive_ptr_release(Comm* c);
36 XBT_PUBLIC void intrusive_ptr_add_ref(Comm* c);
37
38 class ConditionVariable;
39 /** Smart pointer to a simgrid::s4u::ConditionVariable */
40 typedef boost::intrusive_ptr<ConditionVariable> ConditionVariablePtr;
41 XBT_PUBLIC void intrusive_ptr_release(const ConditionVariable* c);
42 XBT_PUBLIC void intrusive_ptr_add_ref(const ConditionVariable* c);
43
44 class Engine;
45
46 class Exec;
47 /** Smart pointer to a simgrid::s4u::Exec */
48 typedef boost::intrusive_ptr<Exec> ExecPtr;
49 XBT_PUBLIC void intrusive_ptr_release(Exec* e);
50 XBT_PUBLIC void intrusive_ptr_add_ref(Exec* e);
51 class ExecSeq;
52 typedef boost::intrusive_ptr<ExecSeq> ExecSeqPtr;
53 class ExecPar;
54 typedef boost::intrusive_ptr<ExecPar> ExecParPtr;
55
56 class Host;
57
58 class Io;
59 /** Smart pointer to a simgrid::s4u::Io */
60 typedef boost::intrusive_ptr<Io> IoPtr;
61 XBT_PUBLIC void intrusive_ptr_release(Io* i);
62 XBT_PUBLIC void intrusive_ptr_add_ref(Io* i);
63
64 class Link;
65
66 class Mailbox;
67
68 class Mutex;
69 XBT_PUBLIC void intrusive_ptr_release(const Mutex* m);
70 XBT_PUBLIC void intrusive_ptr_add_ref(const Mutex* m);
71 /**
72  * @beginrst
73  * Smart pointer to a :cpp:type:`simgrid::s4u::Mutex`
74  * @endrst
75  */
76 typedef boost::intrusive_ptr<Mutex> MutexPtr;
77
78 class NetZone;
79 class VirtualMachine;
80 class File;
81
82 class Semaphore;
83 /** Smart pointer to a simgrid::s4u::Semaphore */
84 typedef boost::intrusive_ptr<Semaphore> SemaphorePtr;
85 XBT_PUBLIC void intrusive_ptr_release(Semaphore* m);
86 XBT_PUBLIC void intrusive_ptr_add_ref(Semaphore* m);
87
88 class Disk;
89 class Storage;
90 } // namespace s4u
91
92 namespace config {
93 template <class T> class Flag;
94 }
95
96 namespace kernel {
97 class EngineImpl;
98 namespace actor {
99 class ActorImpl;
100 typedef boost::intrusive_ptr<ActorImpl> ActorImplPtr;
101 } // namespace actor
102
103 namespace activity {
104   class ActivityImpl;
105   enum class State;
106   typedef boost::intrusive_ptr<ActivityImpl> ActivityImplPtr;
107   XBT_PUBLIC void intrusive_ptr_add_ref(ActivityImpl* activity);
108   XBT_PUBLIC void intrusive_ptr_release(ActivityImpl* activity);
109
110   class ConditionVariableImpl;
111
112   class CommImpl;
113   typedef boost::intrusive_ptr<CommImpl> CommImplPtr;
114   class ExecImpl;
115   typedef boost::intrusive_ptr<ExecImpl> ExecImplPtr;
116   class IoImpl;
117   typedef boost::intrusive_ptr<IoImpl> IoImplPtr;
118   class MutexImpl;
119   typedef boost::intrusive_ptr<MutexImpl> MutexImplPtr;
120   class RawImpl;
121   typedef boost::intrusive_ptr<RawImpl> RawImplPtr;
122   class SemaphoreImpl;
123   typedef boost::intrusive_ptr<SemaphoreImpl> SemaphoreImplPtr;
124   class SleepImpl;
125   typedef boost::intrusive_ptr<SleepImpl> SleepImplPtr;
126
127   class MailboxImpl;
128 }
129 namespace context {
130 class Context;
131 class ContextFactory;
132 } // namespace context
133 namespace lmm {
134 class Element;
135 class Variable;
136 class Constraint;
137 class ConstraintLight;
138 class System;
139 }
140 namespace resource {
141 class Action;
142 class Cpu;
143 class Model;
144 class Resource;
145 class CpuModel;
146 class NetworkModel;
147 class LinkImpl;
148 class NetworkAction;
149 class DiskImpl;
150 class DiskModel;
151 class StorageImpl;
152 class StorageType;
153 class StorageModel;
154 }
155 namespace routing {
156 class ClusterCreationArgs;
157 class LinkCreationArgs;
158 class NetPoint;
159 class NetZoneImpl;
160 class RouteCreationArgs;
161 }
162 namespace profile {
163 class Event;
164 class FutureEvtSet;
165 class Profile;
166 } // namespace profile
167 } // namespace kernel
168 namespace simix {
169   class Host;
170   class Timer;
171 }
172 namespace surf {
173   class HostImpl;
174   class HostModel;
175 }
176 namespace mc {
177 class CommunicationDeterminismChecker;
178 class SimcallInspector;
179 }
180 namespace vm {
181 class VMModel;
182 class VirtualMachineImpl;
183 } // namespace vm
184 } // namespace simgrid
185
186 typedef simgrid::s4u::Actor s4u_Actor;
187 typedef simgrid::s4u::Barrier s4u_Barrier;
188 typedef simgrid::s4u::Host s4u_Host;
189 typedef simgrid::s4u::Link s4u_Link;
190 typedef simgrid::s4u::File s4u_File;
191 typedef simgrid::s4u::ConditionVariable s4u_ConditionVariable;
192 typedef simgrid::s4u::Mutex s4u_Mutex;
193 typedef simgrid::s4u::Semaphore s4u_Semaphore;
194 typedef simgrid::s4u::Disk s4u_Disk;
195 typedef simgrid::s4u::Storage s4u_Storage;
196 typedef simgrid::s4u::NetZone s4u_NetZone;
197 typedef simgrid::s4u::VirtualMachine s4u_VM;
198 typedef boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> smx_activity_t;
199
200 typedef simgrid::simix::Timer* smx_timer_t;
201 typedef simgrid::kernel::actor::ActorImpl* smx_actor_t;
202 typedef simgrid::kernel::activity::ConditionVariableImpl* smx_cond_t;
203 typedef simgrid::kernel::activity::MailboxImpl* smx_mailbox_t;
204 typedef simgrid::kernel::activity::MutexImpl* smx_mutex_t;
205 typedef simgrid::kernel::activity::SemaphoreImpl* smx_sem_t;
206 typedef simgrid::kernel::activity::State e_smx_state_t;
207 #else
208
209 typedef struct s4u_Actor s4u_Actor;
210 typedef struct s4u_Barrier s4u_Barrier;
211 typedef struct s4u_Host s4u_Host;
212 typedef struct s4u_Link s4u_Link;
213 typedef struct s4u_File s4u_File;
214 typedef struct s4u_ConditionVariable s4u_ConditionVariable;
215 typedef struct s4u_Mutex s4u_Mutex;
216 typedef struct s4u_Semaphore s4u_Semaphore;
217 typedef struct s4u_Disk s4u_Disk;
218 typedef struct s4u_Storage s4u_Storage;
219 typedef struct s4u_NetZone s4u_NetZone;
220 typedef struct s4u_VM s4u_VM;
221 typedef struct kernel_Activity* smx_activity_t;
222 typedef enum kernel_activity_state e_smx_state_t;
223
224 typedef struct s_smx_timer* smx_timer_t;
225 typedef struct s_smx_actor* smx_actor_t;
226 typedef struct s_smx_cond_t* smx_cond_t;
227 typedef struct s_smx_mailbox* smx_mailbox_t;
228 typedef struct s_smx_mutex* smx_mutex_t;
229 typedef struct s_smx_sem* smx_sem_t;
230
231 #endif
232
233 typedef s4u_Barrier* sg_bar_t;
234 typedef const s4u_Barrier* const_sg_bar_t;
235 typedef s4u_ConditionVariable* sg_cond_t;
236 typedef const s4u_ConditionVariable* const_sg_cond_t;
237 typedef s4u_Mutex* sg_mutex_t;
238 typedef const s4u_Mutex* const_sg_mutex_t;
239 typedef s4u_Semaphore* sg_sem_t;
240 typedef const s4u_Semaphore* const_sg_sem_t;
241 typedef s4u_NetZone* sg_netzone_t;
242 typedef const s4u_NetZone* const_sg_netzone_t;
243 typedef s4u_Host* sg_host_t;
244 typedef const s4u_Host* const_sg_host_t;
245 typedef s4u_Link* sg_link_t;
246 typedef const s4u_Link* const_sg_link_t;
247 typedef s4u_Disk* sg_disk_t;
248 typedef const s4u_Disk* const_sg_disk_t;
249 typedef s4u_Storage* sg_storage_t;
250 typedef const s4u_Storage* const_sg_storage_t;
251 typedef s4u_File* sg_file_t;
252 typedef const s4u_File* const_sg_file_t;
253 typedef s4u_VM* sg_vm_t;
254 typedef const s4u_VM* const_sg_vm_t;
255 typedef s4u_Actor* sg_actor_t;
256 typedef const s4u_Actor* const_sg_actor_t;
257
258 typedef struct s_smx_simcall* smx_simcall_t;
259
260 /** @ingroup m_datatypes_management_details
261  * @brief Type for any simgrid size
262  */
263 typedef unsigned long long sg_size_t;
264
265 /** @ingroup m_datatypes_management_details
266  * @brief Type for any simgrid offset
267  */
268 typedef long long sg_offset_t;
269
270 /** Actor's ID, just like the classical processes' have PID in UNIX */
271 typedef long aid_t;
272
273 #endif /* SIMGRID_TYPES_H */