Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' into v3.20-expose-simgrid-jni
[simgrid.git] / include / simgrid / forward.h
1 /* Copyright (c) 2004-2018. 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
52 class Host;
53
54 class Io;
55 /** Smart pointer to a simgrid::s4u::Io */
56 typedef boost::intrusive_ptr<Io> IoPtr;
57 XBT_PUBLIC void intrusive_ptr_release(Io* i);
58 XBT_PUBLIC void intrusive_ptr_add_ref(Io* i);
59
60 class Link;
61
62 class Mailbox;
63 /** Smart pointer to a simgrid::s4u::Mailbox */
64 typedef boost::intrusive_ptr<Mailbox> MailboxPtr;
65 XBT_PUBLIC void intrusive_ptr_release(Mailbox* m);
66 XBT_PUBLIC void intrusive_ptr_add_ref(Mailbox* m);
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 Storage;
85 } // namespace s4u
86
87 namespace config {
88 template <class T> class Flag;
89 }
90
91 namespace kernel {
92 class EngineImpl;
93 namespace actor {
94 class ActorImpl;
95 typedef boost::intrusive_ptr<ActorImpl> ActorImplPtr;
96 } // namespace actor
97
98 namespace activity {
99   class ActivityImpl;
100   typedef boost::intrusive_ptr<ActivityImpl> ActivityImplPtr;
101   XBT_PUBLIC void intrusive_ptr_add_ref(ActivityImpl* activity);
102   XBT_PUBLIC void intrusive_ptr_release(ActivityImpl* activity);
103
104   class ConditionVariableImpl;
105
106   class CommImpl;
107   typedef boost::intrusive_ptr<CommImpl> CommImplPtr;
108   class ExecImpl;
109   typedef boost::intrusive_ptr<ExecImpl> ExecImplPtr;
110   class IoImpl;
111   typedef boost::intrusive_ptr<IoImpl> IoImplPtr;
112   class MutexImpl;
113   typedef boost::intrusive_ptr<MutexImpl> MutexImplPtr;
114   class RawImpl;
115   typedef boost::intrusive_ptr<RawImpl> RawImplPtr;
116   class SleepImpl;
117   typedef boost::intrusive_ptr<SleepImpl> SleepImplPtr;
118
119   class MailboxImpl;
120 }
121 namespace context {
122 class Context;
123 class ContextFactory;
124 } // namespace context
125 namespace lmm {
126 class Element;
127 class Variable;
128 class Constraint;
129 class ConstraintLight;
130 class System;
131 }
132 namespace resource {
133 class Action;
134 class Model;
135 class Resource;
136 class NetworkModel;
137 class TraceEvent;
138 class LinkImpl;
139 class NetworkAction;
140 }
141 namespace routing {
142 class ClusterCreationArgs;
143 class LinkCreationArgs;
144 class NetPoint;
145 class NetZoneImpl;
146 class RouteCreationArgs;
147 }
148 } // namespace kernel
149 namespace simix {
150   class Host;
151 }
152 namespace surf {
153   class Cpu;
154   class CpuModel;
155   class HostImpl;
156   class HostModel;
157   class StorageImpl;
158   class StorageType;
159   class StorageModel;
160 }
161 namespace mc {
162 class CommunicationDeterminismChecker;
163 }
164 namespace trace_mgr {
165   class trace;
166   class future_evt_set;
167 }
168 namespace vm {
169 class VMModel;
170 class VirtualMachineImpl;
171 } // namespace vm
172 } // namespace simgrid
173
174 typedef simgrid::s4u::Actor s4u_Actor;
175 typedef simgrid::s4u::Barrier s4u_Barrier;
176 typedef simgrid::s4u::Host s4u_Host;
177 typedef simgrid::s4u::Link s4u_Link;
178 typedef simgrid::s4u::File s4u_File;
179 typedef simgrid::s4u::Storage s4u_Storage;
180 typedef simgrid::s4u::NetZone s4u_NetZone;
181 typedef simgrid::s4u::VirtualMachine s4u_VM;
182 typedef boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> smx_activity_t;
183 typedef simgrid::trace_mgr::trace* tmgr_trace_t;
184
185 typedef simgrid::kernel::context::Context* smx_context_t;
186 typedef simgrid::kernel::actor::ActorImpl* smx_actor_t;
187 typedef simgrid::kernel::activity::ConditionVariableImpl* smx_cond_t;
188 typedef simgrid::kernel::activity::MutexImpl* smx_mutex_t;
189 typedef simgrid::kernel::activity::MailboxImpl* smx_mailbox_t;
190
191 #else
192
193 typedef struct s4u_Actor s4u_Actor;
194 typedef struct s4u_Barrier s4u_Barrier;
195 typedef struct s4u_Host s4u_Host;
196 typedef struct s4u_Link s4u_Link;
197 typedef struct s4u_File s4u_File;
198 typedef struct s4u_Storage s4u_Storage;
199 typedef struct s4u_NetZone s4u_NetZone;
200 typedef struct s4u_VM s4u_VM;
201 typedef struct kernel_Activity* smx_activity_t;
202
203 typedef struct s_smx_context* smx_context_t;
204 typedef struct s_smx_actor* smx_actor_t;
205 typedef struct s_smx_cond_t* smx_cond_t;
206 typedef struct s_smx_mutex* smx_mutex_t;
207 typedef struct s_smx_mailbox* smx_mailbox_t;
208
209 #endif
210
211 typedef s4u_Barrier* sg_bar_t;
212 typedef s4u_NetZone* sg_netzone_t;
213 typedef s4u_Host* sg_host_t;
214 typedef s4u_Link* sg_link_t;
215 typedef s4u_Storage* sg_storage_t;
216 typedef s4u_File* sg_file_t;
217 typedef s4u_VM* sg_vm_t;
218 typedef s4u_Actor* sg_actor_t;
219
220 typedef struct s_smx_simcall* smx_simcall_t;
221
222 /** @ingroup m_datatypes_management_details
223  * @brief Type for any simgrid size
224  */
225 typedef unsigned long long sg_size_t;
226
227 /** @ingroup m_datatypes_management_details
228  * @brief Type for any simgrid offset
229  */
230 typedef long long sg_offset_t;
231
232 typedef long aid_t;
233
234 #endif /* SIMGRID_TYPES_H */