Logo AND Algorithmique Numérique Distribuée

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