Logo AND Algorithmique Numérique Distribuée

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