Logo AND Algorithmique Numérique Distribuée

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