Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Make cmd-line option "network/TCP-gamma" neat and clean
[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 config {
18 template <class T> class Flag;
19 }
20 namespace kernel {
21 class EngineImpl;
22 namespace context {
23 class Context;
24 class ContextFactory;
25 }
26 namespace actor {
27 class ActorImpl;
28 using ActorImplPtr = boost::intrusive_ptr<ActorImpl>;
29 } // namespace actor
30 namespace activity {
31   class ActivityImpl;
32   using ActivityImplPtr = boost::intrusive_ptr<ActivityImpl>;
33   XBT_PUBLIC void intrusive_ptr_add_ref(ActivityImpl* activity);
34   XBT_PUBLIC void intrusive_ptr_release(ActivityImpl* activity);
35
36   class CommImpl;
37   using CommImplPtr = boost::intrusive_ptr<CommImpl>;
38   class ExecImpl;
39   using ExecImplPtr = boost::intrusive_ptr<ExecImpl>;
40   class IoImpl;
41   using IoImplPtr = boost::intrusive_ptr<IoImpl>;
42   class MutexImpl;
43   using MutexImplPtr = boost::intrusive_ptr<MutexImpl>;
44   class RawImpl;
45   using RawImplPtr = boost::intrusive_ptr<RawImpl>;
46   class SleepImpl;
47   using SleepImplPtr = boost::intrusive_ptr<SleepImpl>;
48
49   class MailboxImpl;
50 }
51 namespace lmm {
52 class Element;
53 class Variable;
54 class Constraint;
55 class ConstraintLight;
56 class System;
57 }
58 namespace resource {
59 class Action;
60 class Model;
61 class Resource;
62 class TraceEvent;
63 }
64 namespace routing {
65 class ClusterCreationArgs;
66 class LinkCreationArgs;
67 class NetPoint;
68 class NetZoneImpl;
69 class RouteCreationArgs;
70 }
71 }
72 namespace simix {
73   class Host;
74 }
75
76 namespace surf {
77   class Cpu;
78   class LinkImpl;
79   class HostImpl;
80   class StorageImpl;
81   class StorageType;
82 }
83 namespace trace_mgr {
84   class trace;
85   class future_evt_set;
86 }
87 }
88
89 typedef simgrid::s4u::Actor s4u_Actor;
90 typedef simgrid::s4u::Host s4u_Host;
91 typedef simgrid::s4u::Link s4u_Link;
92 typedef simgrid::s4u::File s4u_File;
93 typedef simgrid::s4u::Storage s4u_Storage;
94 typedef simgrid::s4u::NetZone s4u_NetZone;
95 typedef simgrid::s4u::VirtualMachine s4u_VM;
96 typedef boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> smx_activity_t;
97 typedef simgrid::trace_mgr::trace* tmgr_trace_t;
98
99 typedef simgrid::kernel::context::Context* smx_context_t;
100 typedef simgrid::kernel::actor::ActorImpl* smx_actor_t;
101 typedef simgrid::kernel::activity::MutexImpl* smx_mutex_t;
102 typedef simgrid::kernel::activity::MailboxImpl* smx_mailbox_t;
103 typedef simgrid::surf::StorageImpl* surf_storage_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
116 typedef struct s_smx_context* smx_context_t;
117 typedef struct s_smx_actor* smx_actor_t;
118 typedef struct s_smx_mutex* smx_mutex_t;
119 typedef struct s_smx_mailbox* smx_mailbox_t;
120 typedef struct s_surf_storage* surf_storage_t;
121
122 #endif
123
124 typedef s4u_NetZone* sg_netzone_t;
125 typedef s4u_Host* sg_host_t;
126 typedef s4u_Link* sg_link_t;
127 typedef s4u_Storage* sg_storage_t;
128 typedef s4u_File* sg_file_t;
129 typedef s4u_VM* sg_vm_t;
130 typedef s4u_Actor* sg_actor_t;
131
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_SPLITDUPLEX = 2,
136   SURF_LINK_SHARED      = 1,
137   SURF_LINK_FATPIPE     = 0
138 } e_surf_link_sharing_policy_t;
139
140 /** @ingroup m_datatypes_management_details
141  * @brief Type for any simgrid size
142  */
143 typedef unsigned long long sg_size_t;
144
145 /** @ingroup m_datatypes_management_details
146  * @brief Type for any simgrid offset
147  */
148 typedef long long sg_offset_t;
149
150 typedef long aid_t;
151
152 #endif /* SIMGRID_TYPES_H */