Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add C interface to s4u::Barrier
[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 class Actor;
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);
23 class Barrier;
24 class Comm;
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);
28 class Engine;
29 class Exec;
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);
33 class Host;
34 class Link;
35 class Mailbox;
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);
39 class Mutex;
40 XBT_PUBLIC void intrusive_ptr_release(Mutex* m);
41 XBT_PUBLIC void intrusive_ptr_add_ref(Mutex* m);
42 class NetZone;
43 class VirtualMachine;
44 class File;
45 class Storage;
46 } // namespace s4u
47
48 namespace config {
49 template <class T> class Flag;
50 }
51
52 namespace kernel {
53 class EngineImpl;
54 namespace actor {
55 class ActorImpl;
56 using ActorImplPtr = boost::intrusive_ptr<ActorImpl>;
57 } // namespace actor
58
59 namespace activity {
60   class ActivityImpl;
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);
64
65   class ConditionVariableImpl;
66
67   class CommImpl;
68   using CommImplPtr = boost::intrusive_ptr<CommImpl>;
69   class ExecImpl;
70   using ExecImplPtr = boost::intrusive_ptr<ExecImpl>;
71   class IoImpl;
72   using IoImplPtr = boost::intrusive_ptr<IoImpl>;
73   class MutexImpl;
74   using MutexImplPtr = boost::intrusive_ptr<MutexImpl>;
75   class RawImpl;
76   using RawImplPtr = boost::intrusive_ptr<RawImpl>;
77   class SleepImpl;
78   using SleepImplPtr = boost::intrusive_ptr<SleepImpl>;
79
80   class MailboxImpl;
81 }
82 namespace context {
83 class Context;
84 class ContextFactory;
85 } // namespace context
86 namespace lmm {
87 class Element;
88 class Variable;
89 class Constraint;
90 class ConstraintLight;
91 class System;
92 }
93 namespace resource {
94 class Action;
95 class Model;
96 class Resource;
97 class TraceEvent;
98 class LinkImpl;
99 class NetworkAction;
100 }
101 namespace routing {
102 class ClusterCreationArgs;
103 class LinkCreationArgs;
104 class NetPoint;
105 class NetZoneImpl;
106 class RouteCreationArgs;
107 }
108 } // namespace kernel
109 namespace simix {
110   class Host;
111 }
112 namespace surf {
113   class Cpu;
114   class CpuModel;
115   class HostImpl;
116   class HostModel;
117   class StorageImpl;
118   class StorageType;
119   class StorageModel;
120 }
121 namespace trace_mgr {
122   class trace;
123   class future_evt_set;
124 }
125 namespace vm {
126 class VMModel;
127 class VirtualMachineImpl;
128 } // namespace vm
129 } // namespace simgrid
130
131 typedef simgrid::s4u::Actor s4u_Actor;
132 typedef simgrid::s4u::Barrier s4u_Barrier;
133 typedef simgrid::s4u::Host s4u_Host;
134 typedef simgrid::s4u::Link s4u_Link;
135 typedef simgrid::s4u::File s4u_File;
136 typedef simgrid::s4u::Storage s4u_Storage;
137 typedef simgrid::s4u::NetZone s4u_NetZone;
138 typedef simgrid::s4u::VirtualMachine s4u_VM;
139 typedef boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> smx_activity_t;
140 typedef simgrid::trace_mgr::trace* tmgr_trace_t;
141
142 typedef simgrid::kernel::context::Context* smx_context_t;
143 typedef simgrid::kernel::actor::ActorImpl* smx_actor_t;
144 typedef simgrid::kernel::activity::ConditionVariableImpl* smx_cond_t;
145 typedef simgrid::kernel::activity::MutexImpl* smx_mutex_t;
146 typedef simgrid::kernel::activity::MailboxImpl* smx_mailbox_t;
147 typedef simgrid::surf::StorageImpl* surf_storage_t;
148
149 #else
150
151 typedef struct s4u_Actor s4u_Actor;
152 typedef struct s4u_Barrier s4u_Barrier;
153 typedef struct s4u_Host s4u_Host;
154 typedef struct s4u_Link s4u_Link;
155 typedef struct s4u_File s4u_File;
156 typedef struct s4u_Storage s4u_Storage;
157 typedef struct s4u_NetZone s4u_NetZone;
158 typedef struct s4u_VM s4u_VM;
159 typedef struct kernel_Activity* smx_activity_t;
160
161 typedef struct s_smx_context* smx_context_t;
162 typedef struct s_smx_actor* smx_actor_t;
163 typedef struct s_smx_cond_t* smx_cond_t;
164 typedef struct s_smx_mutex* smx_mutex_t;
165 typedef struct s_smx_mailbox* smx_mailbox_t;
166 typedef struct s_surf_storage* surf_storage_t;
167
168 #endif
169
170 typedef s4u_Barrier* sg_bar_t;
171 typedef s4u_NetZone* sg_netzone_t;
172 typedef s4u_Host* sg_host_t;
173 typedef s4u_Link* sg_link_t;
174 typedef s4u_Storage* sg_storage_t;
175 typedef s4u_File* sg_file_t;
176 typedef s4u_VM* sg_vm_t;
177 typedef s4u_Actor* sg_actor_t;
178
179 typedef struct s_smx_simcall* smx_simcall_t;
180
181 /** @ingroup m_datatypes_management_details
182  * @brief Type for any simgrid size
183  */
184 typedef unsigned long long sg_size_t;
185
186 /** @ingroup m_datatypes_management_details
187  * @brief Type for any simgrid offset
188  */
189 typedef long long sg_offset_t;
190
191 typedef long aid_t;
192
193 #endif /* SIMGRID_TYPES_H */