Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
6b9d37f6ee09674b213f21826f650c43045cd256
[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 MutexImpl;
34   using MutexImplPtr = boost::intrusive_ptr<MutexImpl>;
35   class RawImpl;
36   using RawImplPtr = boost::intrusive_ptr<RawImpl>;
37   class SleepImpl;
38   using SleepImplPtr = boost::intrusive_ptr<SleepImpl>;
39
40   class MailboxImpl;
41 }
42 namespace lmm {
43 class Element;
44 class Variable;
45 class Constraint;
46 class ConstraintLight;
47 class System;
48 }
49 namespace routing {
50   class NetPoint;
51   class NetZoneImpl;
52 }
53 }
54 namespace simix {
55   class ActorImpl;
56   using ActorImplPtr = boost::intrusive_ptr<ActorImpl>;
57   class Host;
58 }
59
60 namespace surf {
61   class Resource;
62   class Cpu;
63   class LinkImpl;
64   class HostImpl;
65   class StorageImpl;
66   class StorageType;
67 }
68 namespace trace_mgr {
69   class trace;
70   class future_evt_set;
71 }
72 }
73
74 typedef simgrid::s4u::Actor s4u_Actor;
75 typedef simgrid::s4u::Host s4u_Host;
76 typedef simgrid::s4u::Link s4u_Link;
77 typedef simgrid::s4u::File s4u_File;
78 typedef simgrid::s4u::Storage s4u_Storage;
79 typedef simgrid::s4u::NetZone s4u_NetZone;
80 typedef simgrid::s4u::VirtualMachine s4u_VM;
81 typedef boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> smx_activity_t;
82 typedef simgrid::kernel::routing::NetPoint routing_NetPoint;
83 typedef simgrid::surf::Resource surf_Resource;
84 typedef simgrid::trace_mgr::trace tmgr_Trace;
85
86 typedef simgrid::kernel::context::Context* smx_context_t;
87 typedef simgrid::simix::ActorImpl* smx_actor_t;
88 typedef simgrid::kernel::activity::MutexImpl* smx_mutex_t;
89 typedef simgrid::kernel::activity::MailboxImpl* smx_mailbox_t;
90 typedef simgrid::surf::StorageImpl* surf_storage_t;
91
92 typedef simgrid::kernel::lmm::Element* lmm_element_t;
93 typedef const simgrid::kernel::lmm::Element* const_lmm_element_t;
94 typedef simgrid::kernel::lmm::Variable* lmm_variable_t;
95 typedef simgrid::kernel::lmm::Constraint* lmm_constraint_t;
96 typedef simgrid::kernel::lmm::ConstraintLight* lmm_constraint_light_t;
97 typedef simgrid::kernel::lmm::System* lmm_system_t;
98
99 #else
100
101 typedef struct s4u_Actor s4u_Actor;
102 typedef struct s4u_Host s4u_Host;
103 typedef struct s4u_Link s4u_Link;
104 typedef struct s4u_File s4u_File;
105 typedef struct s4u_Storage s4u_Storage;
106 typedef struct s4u_NetZone s4u_NetZone;
107 typedef struct s4u_VM s4u_VM;
108 typedef struct kernel_Activity* smx_activity_t;
109 typedef struct routing_NetPoint routing_NetPoint;
110 typedef struct surf_Resource surf_Resource;
111 typedef struct Trace tmgr_Trace;
112
113 typedef struct s_smx_context* smx_context_t;
114 typedef struct s_smx_actor* smx_actor_t;
115 typedef struct s_smx_mutex* smx_mutex_t;
116 typedef struct s_smx_mailbox* smx_mailbox_t;
117 typedef struct s_surf_storage* surf_storage_t;
118
119 #endif
120
121 typedef s4u_NetZone* sg_netzone_t;
122 typedef s4u_Host* sg_host_t;
123 typedef s4u_Link* sg_link_t;
124 typedef s4u_Storage* sg_storage_t;
125 typedef s4u_File* sg_file_t;
126 typedef s4u_VM* sg_vm_t;
127
128 typedef routing_NetPoint* sg_netpoint_t;
129 typedef surf_Resource *sg_resource_t;
130
131 typedef tmgr_Trace *tmgr_trace_t; /**< Opaque structure defining an availability trace */
132
133 typedef struct s_smx_simcall s_smx_simcall_t;
134 typedef struct s_smx_simcall* smx_simcall_t;
135
136 typedef enum { // FIXME: move this to s4u::Link; make it an enum class
137   SURF_LINK_FULLDUPLEX = 2,
138   SURF_LINK_SHARED     = 1,
139   SURF_LINK_FATPIPE    = 0
140 } e_surf_link_sharing_policy_t;
141
142 typedef enum { // FIXME: move this to s4u::Actor; make it an enum class
143   SURF_ACTOR_ON_FAILURE_DIE     = 1,
144   SURF_ACTOR_ON_FAILURE_RESTART = 0
145 } e_surf_process_on_failure_t;
146
147 /** @ingroup m_datatypes_management_details
148  * @brief Type for any simgrid size
149  */
150 typedef unsigned long long sg_size_t;
151
152 /** @ingroup m_datatypes_management_details
153  * @brief Type for any simgrid offset
154  */
155 typedef long long sg_offset_t;
156
157 typedef unsigned long aid_t;
158
159 #endif /* SIMGRID_TYPES_H */