1 /* Copyright (c) 2004-2018. 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>
20 using ActorPtr = boost::intrusive_ptr<Actor>;
21 XBT_PUBLIC void intrusive_ptr_release(Actor* actor);
22 XBT_PUBLIC void intrusive_ptr_add_ref(Actor* actor);
25 using CommPtr = boost::intrusive_ptr<Comm>;
26 XBT_PUBLIC void intrusive_ptr_release(Comm* c);
27 XBT_PUBLIC void intrusive_ptr_add_ref(Comm* c);
30 using ExecPtr = boost::intrusive_ptr<Exec>;
31 XBT_PUBLIC void intrusive_ptr_release(Exec* e);
32 XBT_PUBLIC void intrusive_ptr_add_ref(Exec* e);
36 using MailboxPtr = boost::intrusive_ptr<Mailbox>;
37 XBT_PUBLIC void intrusive_ptr_release(Mailbox* m);
38 XBT_PUBLIC void intrusive_ptr_add_ref(Mailbox* m);
40 XBT_PUBLIC void intrusive_ptr_release(Mutex* m);
41 XBT_PUBLIC void intrusive_ptr_add_ref(Mutex* m);
49 template <class T> class Flag;
56 using ActorImplPtr = boost::intrusive_ptr<ActorImpl>;
61 using ActivityImplPtr = boost::intrusive_ptr<ActivityImpl>;
62 XBT_PUBLIC void intrusive_ptr_add_ref(ActivityImpl* activity);
63 XBT_PUBLIC void intrusive_ptr_release(ActivityImpl* activity);
65 class ConditionVariableImpl;
68 using CommImplPtr = boost::intrusive_ptr<CommImpl>;
70 using ExecImplPtr = boost::intrusive_ptr<ExecImpl>;
72 using IoImplPtr = boost::intrusive_ptr<IoImpl>;
74 using MutexImplPtr = boost::intrusive_ptr<MutexImpl>;
76 using RawImplPtr = boost::intrusive_ptr<RawImpl>;
78 using SleepImplPtr = boost::intrusive_ptr<SleepImpl>;
85 } // namespace context
90 class ConstraintLight;
103 class ClusterCreationArgs;
104 class LinkCreationArgs;
107 class RouteCreationArgs;
109 } // namespace kernel
123 class CommunicationDeterminismChecker;
125 namespace trace_mgr {
127 class future_evt_set;
131 class VirtualMachineImpl;
133 } // namespace simgrid
135 typedef simgrid::s4u::Actor s4u_Actor;
136 typedef simgrid::s4u::Barrier s4u_Barrier;
137 typedef simgrid::s4u::Host s4u_Host;
138 typedef simgrid::s4u::Link s4u_Link;
139 typedef simgrid::s4u::File s4u_File;
140 typedef simgrid::s4u::Storage s4u_Storage;
141 typedef simgrid::s4u::NetZone s4u_NetZone;
142 typedef simgrid::s4u::VirtualMachine s4u_VM;
143 typedef boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> smx_activity_t;
144 typedef simgrid::trace_mgr::trace* tmgr_trace_t;
146 typedef simgrid::kernel::context::Context* smx_context_t;
147 typedef simgrid::kernel::actor::ActorImpl* smx_actor_t;
148 typedef simgrid::kernel::activity::ConditionVariableImpl* smx_cond_t;
149 typedef simgrid::kernel::activity::MutexImpl* smx_mutex_t;
150 typedef simgrid::kernel::activity::MailboxImpl* smx_mailbox_t;
151 typedef simgrid::surf::StorageImpl* surf_storage_t;
155 typedef struct s4u_Actor s4u_Actor;
156 typedef struct s4u_Barrier s4u_Barrier;
157 typedef struct s4u_Host s4u_Host;
158 typedef struct s4u_Link s4u_Link;
159 typedef struct s4u_File s4u_File;
160 typedef struct s4u_Storage s4u_Storage;
161 typedef struct s4u_NetZone s4u_NetZone;
162 typedef struct s4u_VM s4u_VM;
163 typedef struct kernel_Activity* smx_activity_t;
165 typedef struct s_smx_context* smx_context_t;
166 typedef struct s_smx_actor* smx_actor_t;
167 typedef struct s_smx_cond_t* smx_cond_t;
168 typedef struct s_smx_mutex* smx_mutex_t;
169 typedef struct s_smx_mailbox* smx_mailbox_t;
170 typedef struct s_surf_storage* surf_storage_t;
174 typedef s4u_Barrier* sg_bar_t;
175 typedef s4u_NetZone* sg_netzone_t;
176 typedef s4u_Host* sg_host_t;
177 typedef s4u_Link* sg_link_t;
178 typedef s4u_Storage* sg_storage_t;
179 typedef s4u_File* sg_file_t;
180 typedef s4u_VM* sg_vm_t;
181 typedef s4u_Actor* sg_actor_t;
183 typedef struct s_smx_simcall* smx_simcall_t;
185 /** @ingroup m_datatypes_management_details
186 * @brief Type for any simgrid size
188 typedef unsigned long long sg_size_t;
190 /** @ingroup m_datatypes_management_details
191 * @brief Type for any simgrid offset
193 typedef long long sg_offset_t;
197 #endif /* SIMGRID_TYPES_H */