Logo AND Algorithmique Numérique Distribuée

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