1 /* Copyright (c) 2004-2019. The SimGrid Team. All rights reserved. */
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. */
6 #ifndef SIMGRID_TYPES_H
7 #define SIMGRID_TYPES_H
13 #include <boost/intrusive_ptr.hpp>
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);
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);
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);
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);
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);
52 typedef boost::intrusive_ptr<ExecSeq> ExecSeqPtr;
54 typedef boost::intrusive_ptr<ExecPar> ExecParPtr;
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);
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;
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);
88 template <class T> class Flag;
95 typedef boost::intrusive_ptr<ActorImpl> ActorImplPtr;
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);
104 class ConditionVariableImpl;
107 typedef boost::intrusive_ptr<CommImpl> CommImplPtr;
109 typedef boost::intrusive_ptr<ExecImpl> ExecImplPtr;
111 typedef boost::intrusive_ptr<IoImpl> IoImplPtr;
113 typedef boost::intrusive_ptr<MutexImpl> MutexImplPtr;
115 typedef boost::intrusive_ptr<RawImpl> RawImplPtr;
117 typedef boost::intrusive_ptr<SemaphoreImpl> SemaphoreImplPtr;
119 typedef boost::intrusive_ptr<SleepImpl> SleepImplPtr;
125 class ContextFactory;
126 } // namespace context
131 class ConstraintLight;
148 class ClusterCreationArgs;
149 class LinkCreationArgs;
152 class RouteCreationArgs;
158 } // namespace profile
159 } // namespace kernel
169 class CommunicationDeterminismChecker;
173 class VirtualMachineImpl;
175 } // namespace simgrid
177 typedef simgrid::s4u::Actor s4u_Actor;
178 typedef simgrid::s4u::Barrier s4u_Barrier;
179 typedef simgrid::s4u::Host s4u_Host;
180 typedef simgrid::s4u::Link s4u_Link;
181 typedef simgrid::s4u::File s4u_File;
182 typedef simgrid::s4u::Semaphore s4u_Semaphore;
183 typedef simgrid::s4u::Storage s4u_Storage;
184 typedef simgrid::s4u::NetZone s4u_NetZone;
185 typedef simgrid::s4u::VirtualMachine s4u_VM;
186 typedef boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> smx_activity_t;
188 typedef simgrid::simix::Timer* smx_timer_t;
189 typedef simgrid::kernel::actor::ActorImpl* smx_actor_t;
190 typedef simgrid::kernel::activity::ConditionVariableImpl* smx_cond_t;
191 typedef simgrid::kernel::activity::MailboxImpl* smx_mailbox_t;
192 typedef simgrid::kernel::activity::MutexImpl* smx_mutex_t;
193 typedef simgrid::kernel::activity::SemaphoreImpl* smx_sem_t;
197 typedef struct s4u_Actor s4u_Actor;
198 typedef struct s4u_Barrier s4u_Barrier;
199 typedef struct s4u_Host s4u_Host;
200 typedef struct s4u_Link s4u_Link;
201 typedef struct s4u_File s4u_File;
202 typedef struct s4u_Semaphore s4u_Semaphore;
203 typedef struct s4u_Storage s4u_Storage;
204 typedef struct s4u_NetZone s4u_NetZone;
205 typedef struct s4u_VM s4u_VM;
206 typedef struct kernel_Activity* smx_activity_t;
208 typedef struct s_smx_timer* smx_timer_t;
209 typedef struct s_smx_actor* smx_actor_t;
210 typedef struct s_smx_cond_t* smx_cond_t;
211 typedef struct s_smx_mailbox* smx_mailbox_t;
212 typedef struct s_smx_mutex* smx_mutex_t;
213 typedef struct s_smx_sem* smx_sem_t;
217 typedef s4u_Barrier* sg_bar_t;
218 typedef s4u_Semaphore* sg_sem_t;
219 typedef s4u_NetZone* sg_netzone_t;
220 typedef s4u_Host* sg_host_t;
221 typedef s4u_Link* sg_link_t;
222 typedef s4u_Storage* sg_storage_t;
223 typedef s4u_File* sg_file_t;
224 typedef s4u_VM* sg_vm_t;
225 typedef s4u_Actor* sg_actor_t;
227 typedef struct s_smx_simcall* smx_simcall_t;
229 /** @ingroup m_datatypes_management_details
230 * @brief Type for any simgrid size
232 typedef unsigned long long sg_size_t;
234 /** @ingroup m_datatypes_management_details
235 * @brief Type for any simgrid offset
237 typedef long long sg_offset_t;
239 /** Actor's ID, just like the classical processes' have PID in UNIX */
242 #endif /* SIMGRID_TYPES_H */