1 /* Copyright (c) 2004-2018. The SimGrid Team. All rights reserved. */
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. */
6 #ifndef SIMGRID_TYPES_H
7 #define SIMGRID_TYPES_H
11 #include "s4u/forward.hpp"
13 #include <boost/intrusive_ptr.hpp>
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);
29 using CommImplPtr = boost::intrusive_ptr<CommImpl>;
31 using ExecImplPtr = boost::intrusive_ptr<ExecImpl>;
33 using IoImplPtr = boost::intrusive_ptr<IoImpl>;
35 using MutexImplPtr = boost::intrusive_ptr<MutexImpl>;
37 using RawImplPtr = boost::intrusive_ptr<RawImpl>;
39 using SleepImplPtr = boost::intrusive_ptr<SleepImpl>;
47 class ConstraintLight;
60 using ActorImplPtr = boost::intrusive_ptr<ActorImpl>;
77 typedef simgrid::s4u::Actor s4u_Actor;
78 typedef simgrid::s4u::Host s4u_Host;
79 typedef simgrid::s4u::Link s4u_Link;
80 typedef simgrid::s4u::File s4u_File;
81 typedef simgrid::s4u::Storage s4u_Storage;
82 typedef simgrid::s4u::NetZone s4u_NetZone;
83 typedef simgrid::s4u::VirtualMachine s4u_VM;
84 typedef boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> smx_activity_t;
85 typedef simgrid::kernel::routing::NetPoint routing_NetPoint;
86 typedef simgrid::kernel::resource::Resource surf_Resource;
87 typedef simgrid::trace_mgr::trace tmgr_Trace;
89 typedef simgrid::kernel::context::Context* smx_context_t;
90 typedef simgrid::simix::ActorImpl* smx_actor_t;
91 typedef simgrid::kernel::activity::MutexImpl* smx_mutex_t;
92 typedef simgrid::kernel::activity::MailboxImpl* smx_mailbox_t;
93 typedef simgrid::surf::StorageImpl* surf_storage_t;
95 typedef simgrid::kernel::lmm::Element* lmm_element_t;
96 typedef const simgrid::kernel::lmm::Element* const_lmm_element_t;
97 typedef simgrid::kernel::lmm::ConstraintLight* lmm_constraint_light_t;
98 typedef simgrid::kernel::lmm::System* lmm_system_t;
102 typedef struct s4u_Actor s4u_Actor;
103 typedef struct s4u_Host s4u_Host;
104 typedef struct s4u_Link s4u_Link;
105 typedef struct s4u_File s4u_File;
106 typedef struct s4u_Storage s4u_Storage;
107 typedef struct s4u_NetZone s4u_NetZone;
108 typedef struct s4u_VM s4u_VM;
109 typedef struct kernel_Activity* smx_activity_t;
110 typedef struct routing_NetPoint routing_NetPoint;
111 typedef struct surf_Resource surf_Resource;
112 typedef struct Trace tmgr_Trace;
114 typedef struct s_smx_context* smx_context_t;
115 typedef struct s_smx_actor* smx_actor_t;
116 typedef struct s_smx_mutex* smx_mutex_t;
117 typedef struct s_smx_mailbox* smx_mailbox_t;
118 typedef struct s_surf_storage* surf_storage_t;
122 typedef s4u_NetZone* sg_netzone_t;
123 typedef s4u_Host* sg_host_t;
124 typedef s4u_Link* sg_link_t;
125 typedef s4u_Storage* sg_storage_t;
126 typedef s4u_File* sg_file_t;
127 typedef s4u_VM* sg_vm_t;
129 typedef routing_NetPoint* sg_netpoint_t;
130 typedef surf_Resource *sg_resource_t;
132 typedef tmgr_Trace *tmgr_trace_t; /**< Opaque structure defining an availability trace */
134 typedef struct s_smx_simcall s_smx_simcall_t;
135 typedef struct s_smx_simcall* smx_simcall_t;
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;
143 /** @ingroup m_datatypes_management_details
144 * @brief Type for any simgrid size
146 typedef unsigned long long sg_size_t;
148 /** @ingroup m_datatypes_management_details
149 * @brief Type for any simgrid offset
151 typedef long long sg_offset_t;
153 typedef unsigned long aid_t;
155 #endif /* SIMGRID_TYPES_H */