Logo AND Algorithmique Numérique Distribuée

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