Logo AND Algorithmique Numérique Distribuée

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