Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Kill useless typedefs routing_NetPoint and sg_netpoint_t.
[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 actor {
24 class ActorImpl;
25 using ActorImplPtr = boost::intrusive_ptr<ActorImpl>;
26 } // namespace actor
27 namespace activity {
28   class ActivityImpl;
29   using ActivityImplPtr = boost::intrusive_ptr<ActivityImpl>;
30   XBT_PUBLIC void intrusive_ptr_add_ref(ActivityImpl* activity);
31   XBT_PUBLIC void intrusive_ptr_release(ActivityImpl* activity);
32
33   class CommImpl;
34   using CommImplPtr = boost::intrusive_ptr<CommImpl>;
35   class ExecImpl;
36   using ExecImplPtr = boost::intrusive_ptr<ExecImpl>;
37   class IoImpl;
38   using IoImplPtr = boost::intrusive_ptr<IoImpl>;
39   class MutexImpl;
40   using MutexImplPtr = boost::intrusive_ptr<MutexImpl>;
41   class RawImpl;
42   using RawImplPtr = boost::intrusive_ptr<RawImpl>;
43   class SleepImpl;
44   using SleepImplPtr = boost::intrusive_ptr<SleepImpl>;
45
46   class MailboxImpl;
47 }
48 namespace lmm {
49 class Element;
50 class Variable;
51 class Constraint;
52 class ConstraintLight;
53 class System;
54 }
55 namespace resource {
56 class Action;
57 class Model;
58 class Resource;
59 class TraceEvent;
60 }
61 namespace routing {
62 class ClusterCreationArgs;
63 class LinkCreationArgs;
64 class NetPoint;
65 class NetZoneImpl;
66 class RouteCreationArgs;
67 }
68 }
69 namespace simix {
70   class Host;
71 }
72
73 namespace surf {
74   class Cpu;
75   class LinkImpl;
76   class HostImpl;
77   class StorageImpl;
78   class StorageType;
79 }
80 namespace trace_mgr {
81   class trace;
82   class future_evt_set;
83 }
84 }
85
86 typedef simgrid::s4u::Actor s4u_Actor;
87 typedef simgrid::s4u::Host s4u_Host;
88 typedef simgrid::s4u::Link s4u_Link;
89 typedef simgrid::s4u::File s4u_File;
90 typedef simgrid::s4u::Storage s4u_Storage;
91 typedef simgrid::s4u::NetZone s4u_NetZone;
92 typedef simgrid::s4u::VirtualMachine s4u_VM;
93 typedef boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> smx_activity_t;
94 typedef simgrid::trace_mgr::trace tmgr_Trace;
95
96 typedef simgrid::kernel::context::Context* smx_context_t;
97 typedef simgrid::kernel::actor::ActorImpl* smx_actor_t;
98 typedef simgrid::kernel::activity::MutexImpl* smx_mutex_t;
99 typedef simgrid::kernel::activity::MailboxImpl* smx_mailbox_t;
100 typedef simgrid::surf::StorageImpl* surf_storage_t;
101
102 typedef const simgrid::kernel::lmm::Element* const_lmm_element_t;
103 typedef simgrid::kernel::lmm::ConstraintLight* lmm_constraint_light_t;
104
105 #else
106
107 typedef struct s4u_Actor s4u_Actor;
108 typedef struct s4u_Host s4u_Host;
109 typedef struct s4u_Link s4u_Link;
110 typedef struct s4u_File s4u_File;
111 typedef struct s4u_Storage s4u_Storage;
112 typedef struct s4u_NetZone s4u_NetZone;
113 typedef struct s4u_VM s4u_VM;
114 typedef struct kernel_Activity* smx_activity_t;
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 typedef s4u_Actor* sg_actor_t;
132
133 typedef tmgr_Trace *tmgr_trace_t; /**< Opaque structure defining an availability trace */
134
135 typedef struct s_smx_simcall* smx_simcall_t;
136
137 typedef enum { // FIXME: move this to s4u::Link; make it an enum class
138   SURF_LINK_SPLITDUPLEX = 2,
139   SURF_LINK_SHARED      = 1,
140   SURF_LINK_FATPIPE     = 0
141 } e_surf_link_sharing_policy_t;
142
143 /** @ingroup m_datatypes_management_details
144  * @brief Type for any simgrid size
145  */
146 typedef unsigned long long sg_size_t;
147
148 /** @ingroup m_datatypes_management_details
149  * @brief Type for any simgrid offset
150  */
151 typedef long long sg_offset_t;
152
153 typedef long aid_t;
154
155 #endif /* SIMGRID_TYPES_H */