Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Constify pointer and reference parameters in src/plugins/.
[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   enum class State;
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 Cpu;
139 class Model;
140 class Resource;
141 class CpuModel;
142 class NetworkModel;
143 class LinkImpl;
144 class NetworkAction;
145 class DiskImpl;
146 class DiskModel;
147 class StorageImpl;
148 class StorageType;
149 class StorageModel;
150 }
151 namespace routing {
152 class ClusterCreationArgs;
153 class LinkCreationArgs;
154 class NetPoint;
155 class NetZoneImpl;
156 class RouteCreationArgs;
157 }
158 namespace profile {
159 class Event;
160 class FutureEvtSet;
161 class Profile;
162 } // namespace profile
163 } // namespace kernel
164 namespace simix {
165   class Host;
166   class Timer;
167 }
168 namespace surf {
169   class HostImpl;
170   class HostModel;
171 }
172 namespace mc {
173 class CommunicationDeterminismChecker;
174 class SimcallInspector;
175 }
176 namespace vm {
177 class VMModel;
178 class VirtualMachineImpl;
179 } // namespace vm
180 } // namespace simgrid
181
182 typedef simgrid::s4u::Actor s4u_Actor;
183 typedef simgrid::s4u::Barrier s4u_Barrier;
184 typedef simgrid::s4u::Host s4u_Host;
185 typedef simgrid::s4u::Link s4u_Link;
186 typedef simgrid::s4u::File s4u_File;
187 typedef simgrid::s4u::ConditionVariable s4u_ConditionVariable;
188 typedef simgrid::s4u::Mutex s4u_Mutex;
189 typedef simgrid::s4u::Semaphore s4u_Semaphore;
190 typedef simgrid::s4u::Disk s4u_Disk;
191 typedef simgrid::s4u::Storage s4u_Storage;
192 typedef simgrid::s4u::NetZone s4u_NetZone;
193 typedef simgrid::s4u::VirtualMachine s4u_VM;
194 typedef boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> smx_activity_t;
195
196 typedef simgrid::simix::Timer* smx_timer_t;
197 typedef simgrid::kernel::actor::ActorImpl* smx_actor_t;
198 typedef simgrid::kernel::activity::ConditionVariableImpl* smx_cond_t;
199 typedef simgrid::kernel::activity::MailboxImpl* smx_mailbox_t;
200 typedef simgrid::kernel::activity::MutexImpl* smx_mutex_t;
201 typedef simgrid::kernel::activity::SemaphoreImpl* smx_sem_t;
202 typedef simgrid::kernel::activity::State e_smx_state_t;
203 #else
204
205 typedef struct s4u_Actor s4u_Actor;
206 typedef struct s4u_Barrier s4u_Barrier;
207 typedef struct s4u_Host s4u_Host;
208 typedef struct s4u_Link s4u_Link;
209 typedef struct s4u_File s4u_File;
210 typedef struct s4u_ConditionVariable s4u_ConditionVariable;
211 typedef struct s4u_Mutex s4u_Mutex;
212 typedef struct s4u_Semaphore s4u_Semaphore;
213 typedef struct s4u_Disk s4u_Disk;
214 typedef struct s4u_Storage s4u_Storage;
215 typedef struct s4u_NetZone s4u_NetZone;
216 typedef struct s4u_VM s4u_VM;
217 typedef struct kernel_Activity* smx_activity_t;
218 typedef enum kernel_activity_state e_smx_state_t;
219
220 typedef struct s_smx_timer* smx_timer_t;
221 typedef struct s_smx_actor* smx_actor_t;
222 typedef struct s_smx_cond_t* smx_cond_t;
223 typedef struct s_smx_mailbox* smx_mailbox_t;
224 typedef struct s_smx_mutex* smx_mutex_t;
225 typedef struct s_smx_sem* smx_sem_t;
226
227 #endif
228
229 typedef s4u_Barrier* sg_bar_t;
230 typedef s4u_ConditionVariable* sg_cond_t;
231 typedef s4u_Mutex* sg_mutex_t;
232 typedef s4u_Semaphore* sg_sem_t;
233 typedef s4u_NetZone* sg_netzone_t;
234 typedef s4u_Host* sg_host_t;
235 typedef const s4u_Host* const_sg_host_t;
236 typedef s4u_Link* sg_link_t;
237 typedef const s4u_Link* const_sg_link_t;
238 typedef s4u_Disk* sg_disk_t;
239 typedef const s4u_Disk* const_sg_disk_t;
240 typedef s4u_Storage* sg_storage_t;
241 typedef const s4u_Storage* const_sg_storage_t;
242 typedef s4u_File* sg_file_t;
243 typedef const s4u_File* const_sg_file_t;
244 typedef s4u_VM* sg_vm_t;
245 typedef const s4u_VM* const_sg_vm_t;
246 typedef s4u_Actor* sg_actor_t;
247 typedef const s4u_Actor* const_sg_actor_t;
248
249 typedef struct s_smx_simcall* smx_simcall_t;
250
251 /** @ingroup m_datatypes_management_details
252  * @brief Type for any simgrid size
253  */
254 typedef unsigned long long sg_size_t;
255
256 /** @ingroup m_datatypes_management_details
257  * @brief Type for any simgrid offset
258  */
259 typedef long long sg_offset_t;
260
261 /** Actor's ID, just like the classical processes' have PID in UNIX */
262 typedef long aid_t;
263
264 #endif /* SIMGRID_TYPES_H */