Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' into disk
[simgrid.git] / include / simgrid / forward.h
1 /* Copyright (c) 2004-2019. 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(Actor* actor);
24 XBT_PUBLIC void intrusive_ptr_add_ref(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(ConditionVariable* c);
42 XBT_PUBLIC void intrusive_ptr_add_ref(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(Mutex* m);
70 XBT_PUBLIC void intrusive_ptr_add_ref(Mutex* m);
71 /** Smart pointer to a simgrid::s4u::Mutex */
72 typedef boost::intrusive_ptr<Mutex> MutexPtr;
73
74 class NetZone;
75 class VirtualMachine;
76 class File;
77
78 class Semaphore;
79 /** Smart pointer to a simgrid::s4u::Semaphore */
80 typedef boost::intrusive_ptr<Semaphore> SemaphorePtr;
81 XBT_PUBLIC void intrusive_ptr_release(Semaphore* m);
82 XBT_PUBLIC void intrusive_ptr_add_ref(Semaphore* m);
83
84 class Disk;
85 class Storage;
86 } // namespace s4u
87
88 namespace config {
89 template <class T> class Flag;
90 }
91
92 namespace kernel {
93 class EngineImpl;
94 namespace actor {
95 class ActorImpl;
96 typedef boost::intrusive_ptr<ActorImpl> ActorImplPtr;
97 } // namespace actor
98
99 namespace activity {
100   class ActivityImpl;
101   typedef boost::intrusive_ptr<ActivityImpl> ActivityImplPtr;
102   XBT_PUBLIC void intrusive_ptr_add_ref(ActivityImpl* activity);
103   XBT_PUBLIC void intrusive_ptr_release(ActivityImpl* activity);
104
105   class ConditionVariableImpl;
106
107   class CommImpl;
108   typedef boost::intrusive_ptr<CommImpl> CommImplPtr;
109   class ExecImpl;
110   typedef boost::intrusive_ptr<ExecImpl> ExecImplPtr;
111   class IoImpl;
112   typedef boost::intrusive_ptr<IoImpl> IoImplPtr;
113   class MutexImpl;
114   typedef boost::intrusive_ptr<MutexImpl> MutexImplPtr;
115   class RawImpl;
116   typedef boost::intrusive_ptr<RawImpl> RawImplPtr;
117   class SemaphoreImpl;
118   typedef boost::intrusive_ptr<SemaphoreImpl> SemaphoreImplPtr;
119   class SleepImpl;
120   typedef boost::intrusive_ptr<SleepImpl> SleepImplPtr;
121
122   class MailboxImpl;
123 }
124 namespace context {
125 class Context;
126 class ContextFactory;
127 } // namespace context
128 namespace lmm {
129 class Element;
130 class Variable;
131 class Constraint;
132 class ConstraintLight;
133 class System;
134 }
135 namespace resource {
136 class Action;
137 class Cpu;
138 class Model;
139 class Resource;
140 class CpuModel;
141 class NetworkModel;
142 class LinkImpl;
143 class NetworkAction;
144 class DiskImpl;
145 class DiskModel;
146 class StorageImpl;
147 class StorageType;
148 class StorageModel;
149 }
150 namespace routing {
151 class ClusterCreationArgs;
152 class LinkCreationArgs;
153 class NetPoint;
154 class NetZoneImpl;
155 class RouteCreationArgs;
156 }
157 namespace profile {
158 class Event;
159 class FutureEvtSet;
160 class Profile;
161 } // namespace profile
162 } // namespace kernel
163 namespace simix {
164   class Host;
165   class Timer;
166 }
167 namespace surf {
168   class HostImpl;
169   class HostModel;
170 }
171 namespace mc {
172 class CommunicationDeterminismChecker;
173 class SimcallInspector;
174 }
175 namespace vm {
176 class VMModel;
177 class VirtualMachineImpl;
178 } // namespace vm
179 } // namespace simgrid
180
181 typedef simgrid::s4u::Actor s4u_Actor;
182 typedef simgrid::s4u::Barrier s4u_Barrier;
183 typedef simgrid::s4u::Host s4u_Host;
184 typedef simgrid::s4u::Link s4u_Link;
185 typedef simgrid::s4u::File s4u_File;
186 typedef simgrid::s4u::ConditionVariable s4u_ConditionVariable;
187 typedef simgrid::s4u::Mutex s4u_Mutex;
188 typedef simgrid::s4u::Semaphore s4u_Semaphore;
189 typedef simgrid::s4u::Disk s4u_Disk;
190 typedef simgrid::s4u::Storage s4u_Storage;
191 typedef simgrid::s4u::NetZone s4u_NetZone;
192 typedef simgrid::s4u::VirtualMachine s4u_VM;
193 typedef boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> smx_activity_t;
194
195 typedef simgrid::simix::Timer* smx_timer_t;
196 typedef simgrid::kernel::actor::ActorImpl* smx_actor_t;
197 typedef simgrid::kernel::activity::ConditionVariableImpl* smx_cond_t;
198 typedef simgrid::kernel::activity::MailboxImpl* smx_mailbox_t;
199 typedef simgrid::kernel::activity::MutexImpl* smx_mutex_t;
200 typedef simgrid::kernel::activity::SemaphoreImpl* smx_sem_t;
201
202 #else
203
204 typedef struct s4u_Actor s4u_Actor;
205 typedef struct s4u_Barrier s4u_Barrier;
206 typedef struct s4u_Host s4u_Host;
207 typedef struct s4u_Link s4u_Link;
208 typedef struct s4u_File s4u_File;
209 typedef struct s4u_ConditionVariable s4u_ConditionVariable;
210 typedef struct s4u_Mutex s4u_Mutex;
211 typedef struct s4u_Semaphore s4u_Semaphore;
212 typedef struct s4u_Disk s4u_Disk;
213 typedef struct s4u_Storage s4u_Storage;
214 typedef struct s4u_NetZone s4u_NetZone;
215 typedef struct s4u_VM s4u_VM;
216 typedef struct kernel_Activity* smx_activity_t;
217
218 typedef struct s_smx_timer* smx_timer_t;
219 typedef struct s_smx_actor* smx_actor_t;
220 typedef struct s_smx_cond_t* smx_cond_t;
221 typedef struct s_smx_mailbox* smx_mailbox_t;
222 typedef struct s_smx_mutex* smx_mutex_t;
223 typedef struct s_smx_sem* smx_sem_t;
224
225 #endif
226
227 typedef s4u_Barrier* sg_bar_t;
228 typedef s4u_ConditionVariable* sg_cond_t;
229 typedef s4u_Mutex* sg_mutex_t;
230 typedef s4u_Semaphore* sg_sem_t;
231 typedef s4u_NetZone* sg_netzone_t;
232 typedef s4u_Host* sg_host_t;
233 typedef s4u_Link* sg_link_t;
234 typedef s4u_Disk* sg_disk_t;
235 typedef s4u_Storage* sg_storage_t;
236 typedef s4u_File* sg_file_t;
237 typedef s4u_VM* sg_vm_t;
238 typedef s4u_Actor* sg_actor_t;
239
240 typedef struct s_smx_simcall* smx_simcall_t;
241
242 /** @ingroup m_datatypes_management_details
243  * @brief Type for any simgrid size
244  */
245 typedef unsigned long long sg_size_t;
246
247 /** @ingroup m_datatypes_management_details
248  * @brief Type for any simgrid offset
249  */
250 typedef long long sg_offset_t;
251
252 /** Actor's ID, just like the classical processes' have PID in UNIX */
253 typedef long aid_t;
254
255 #endif /* SIMGRID_TYPES_H */