Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
317c70f4f4e04a710f11fe31a0f5e58f719fb222
[simgrid.git] / include / simgrid / forward.h
1 /* Copyright (c) 2004-2017. 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 #ifdef __cplusplus
10
11 #include "s4u/forward.hpp"
12 #include "xbt/base.h"
13 #include <boost/intrusive_ptr.hpp>
14
15 namespace simgrid {
16 namespace kernel {
17 namespace context {
18 class Context;
19 class ContextFactory;
20 }
21 namespace activity {
22   class ActivityImpl;
23   using ActivityImplPtr = boost::intrusive_ptr<ActivityImpl>;
24   XBT_PUBLIC(void) intrusive_ptr_add_ref(ActivityImpl* activity);
25   XBT_PUBLIC(void) intrusive_ptr_release(ActivityImpl* activity);
26
27   class CommImpl;
28   using CommImplPtr = boost::intrusive_ptr<CommImpl>;
29   class ExecImpl;
30   using ExecImplPtr = boost::intrusive_ptr<ExecImpl>;
31   class IoImpl;
32   using IoImplPtr = boost::intrusive_ptr<IoImpl>;
33   class RawImpl;
34   using RawImplPtr = boost::intrusive_ptr<RawImpl>;
35   class SleepImpl;
36   using SleepImplPtr = boost::intrusive_ptr<SleepImpl>;
37
38   class MailboxImpl;
39 }
40 namespace lmm {
41 class Element;
42 class Variable;
43 class Constraint;
44 class ConstraintLight;
45 class s_lmm_system_t;
46 }
47 namespace routing {
48   class NetPoint;
49 }
50 }
51 namespace simix {
52   class ActorImpl;
53   using ActorImplPtr = boost::intrusive_ptr<ActorImpl>;
54   class Host;
55
56   class MutexImpl;
57 }
58 namespace surf {
59   class Resource;
60   class Cpu;
61   class LinkImpl;
62   class HostImpl;
63   class StorageImpl;
64   class StorageType;
65 }
66 namespace trace_mgr {
67   class trace;
68   class future_evt_set;
69 }
70 }
71
72 typedef simgrid::s4u::Actor s4u_Actor;
73 typedef simgrid::s4u::Host s4u_Host;
74 typedef simgrid::s4u::Link s4u_Link;
75 typedef simgrid::s4u::File s4u_File;
76 typedef simgrid::s4u::Storage s4u_Storage;
77 typedef simgrid::s4u::NetZone s4u_NetZone;
78 typedef simgrid::s4u::VirtualMachine s4u_VM;
79 typedef boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> smx_activity_t;
80 typedef simgrid::kernel::routing::NetPoint routing_NetPoint;
81 typedef simgrid::surf::Resource surf_Resource;
82 typedef simgrid::trace_mgr::trace tmgr_Trace;
83
84 typedef simgrid::kernel::context::Context* smx_context_t;
85 typedef simgrid::simix::ActorImpl* smx_actor_t;
86 typedef simgrid::simix::MutexImpl* smx_mutex_t;
87 typedef simgrid::kernel::activity::MailboxImpl* smx_mailbox_t;
88 typedef simgrid::surf::StorageImpl* surf_storage_t;
89
90 typedef simgrid::kernel::lmm::Element* lmm_element_t;
91 typedef const simgrid::kernel::lmm::Element* const_lmm_element_t;
92 typedef simgrid::kernel::lmm::Variable* lmm_variable_t;
93 typedef simgrid::kernel::lmm::Constraint* lmm_constraint_t;
94 typedef simgrid::kernel::lmm::ConstraintLight* lmm_constraint_light_t;
95 typedef simgrid::kernel::lmm::s_lmm_system_t* lmm_system_t;
96
97 #else
98
99 typedef struct s4u_Actor s4u_Actor;
100 typedef struct s4u_Host s4u_Host;
101 typedef struct s4u_Link s4u_Link;
102 typedef struct s4u_File s4u_File;
103 typedef struct s4u_Storage s4u_Storage;
104 typedef struct s4u_NetZone s4u_NetZone;
105 typedef struct s4u_VM s4u_VM;
106 typedef struct kernel_Activity* smx_activity_t;
107 typedef struct routing_NetPoint routing_NetPoint;
108 typedef struct surf_Resource surf_Resource;
109 typedef struct Trace tmgr_Trace;
110
111 typedef struct s_smx_context* smx_context_t;
112 typedef struct s_smx_actor* smx_actor_t;
113 typedef struct s_smx_mutex* smx_mutex_t;
114 typedef struct s_smx_mailbox* smx_mailbox_t;
115 typedef struct s_surf_storage* surf_storage_t;
116
117 #endif
118
119 typedef s4u_NetZone* sg_netzone_t;
120 typedef s4u_Host* sg_host_t;
121 typedef s4u_Link* sg_link_t;
122 typedef s4u_Storage* sg_storage_t;
123 typedef s4u_File* sg_file_t;
124 typedef s4u_VM* sg_vm_t;
125
126 typedef routing_NetPoint* sg_netpoint_t;
127 typedef surf_Resource *sg_resource_t;
128
129 typedef tmgr_Trace *tmgr_trace_t; /**< Opaque structure defining an availability trace */
130
131 typedef struct s_smx_simcall s_smx_simcall_t;
132 typedef struct s_smx_simcall* smx_simcall_t;
133
134 typedef enum { // FIXME: move this to s4u::Link; make it an enum class
135   SURF_LINK_FULLDUPLEX = 2,
136   SURF_LINK_SHARED     = 1,
137   SURF_LINK_FATPIPE    = 0
138 } e_surf_link_sharing_policy_t;
139
140 typedef enum { // FIXME: move this away; make it an enum class
141   SURF_TRACE_CONNECT_KIND_HOST_AVAIL = 4,
142   SURF_TRACE_CONNECT_KIND_SPEED      = 3,
143   SURF_TRACE_CONNECT_KIND_LINK_AVAIL = 2,
144   SURF_TRACE_CONNECT_KIND_BANDWIDTH  = 1,
145   SURF_TRACE_CONNECT_KIND_LATENCY    = 0
146 } e_surf_trace_connect_kind_t;
147
148 typedef enum { // FIXME: move this to s4u::Actor; make it an enum class
149   SURF_ACTOR_ON_FAILURE_DIE     = 1,
150   SURF_ACTOR_ON_FAILURE_RESTART = 0
151 } e_surf_process_on_failure_t;
152
153 /** @ingroup m_datatypes_management_details
154  * @brief Type for any simgrid size
155  */
156 typedef unsigned long long sg_size_t;
157
158 /** @ingroup m_datatypes_management_details
159  * @brief Type for any simgrid offset
160  */
161 typedef long long sg_offset_t;
162
163 typedef unsigned long aid_t;
164
165 #endif /* SIMGRID_TYPES_H */