1 /* Copyright (c) 2004-2017. 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>
23 using ActivityImplPtr = boost::intrusive_ptr<ActivityImpl>;
24 XBT_PUBLIC(void) intrusive_ptr_add_ref(ActivityImpl* activity);
25 XBT_PUBLIC(void) intrusive_ptr_release(ActivityImpl* activity);
28 using CommImplPtr = boost::intrusive_ptr<CommImpl>;
30 using ExecImplPtr = boost::intrusive_ptr<ExecImpl>;
32 using IoImplPtr = boost::intrusive_ptr<IoImpl>;
34 using RawImplPtr = boost::intrusive_ptr<RawImpl>;
36 using SleepImplPtr = boost::intrusive_ptr<SleepImpl>;
47 using ActorImplPtr = boost::intrusive_ptr<ActorImpl>;
66 typedef simgrid::s4u::Actor s4u_Actor;
67 typedef simgrid::s4u::Host s4u_Host;
68 typedef simgrid::s4u::Link s4u_Link;
69 typedef simgrid::s4u::File s4u_File;
70 typedef simgrid::s4u::Storage s4u_Storage;
71 typedef simgrid::s4u::NetZone s4u_NetZone;
72 typedef boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> smx_activity_t;
73 typedef simgrid::kernel::routing::NetPoint routing_NetPoint;
74 typedef simgrid::surf::Resource surf_Resource;
75 typedef simgrid::trace_mgr::trace tmgr_Trace;
77 typedef simgrid::kernel::context::Context* smx_context_t;
78 typedef simgrid::simix::ActorImpl* smx_actor_t;
79 typedef simgrid::simix::MutexImpl* smx_mutex_t;
80 typedef simgrid::kernel::activity::MailboxImpl* smx_mailbox_t;
84 typedef struct s4u_Actor s4u_Actor;
85 typedef struct s4u_Host s4u_Host;
86 typedef struct s4u_Link s4u_Link;
87 typedef struct s4u_File s4u_File;
88 typedef struct s4u_Storage s4u_Storage;
89 typedef struct s4u_NetZone s4u_NetZone;
90 typedef struct kernel_Activity* smx_activity_t;
91 typedef struct routing_NetPoint routing_NetPoint;
92 typedef struct surf_Resource surf_Resource;
93 typedef struct Trace tmgr_Trace;
95 typedef struct s_smx_context* smx_context_t;
96 typedef struct s_smx_actor* smx_actor_t;
97 typedef struct s_smx_mutex* smx_mutex_t;
98 typedef struct s_smx_mailbox* smx_mailbox_t;
102 typedef s4u_NetZone* sg_netzone_t;
103 typedef s4u_Host* sg_host_t;
104 typedef s4u_Link* sg_link_t;
105 typedef s4u_Storage* sg_storage_t;
106 typedef s4u_File* sg_file_t;
108 typedef routing_NetPoint* sg_netpoint_t;
109 typedef surf_Resource *sg_resource_t;
111 typedef tmgr_Trace *tmgr_trace_t; /**< Opaque structure defining an availability trace */
113 typedef struct s_smx_simcall s_smx_simcall_t;
114 typedef struct s_smx_simcall* smx_simcall_t;
117 SURF_LINK_FULLDUPLEX = 2,
118 SURF_LINK_SHARED = 1,
119 SURF_LINK_FATPIPE = 0
120 } e_surf_link_sharing_policy_t;
123 SURF_TRACE_CONNECT_KIND_HOST_AVAIL = 4,
124 SURF_TRACE_CONNECT_KIND_SPEED = 3,
125 SURF_TRACE_CONNECT_KIND_LINK_AVAIL = 2,
126 SURF_TRACE_CONNECT_KIND_BANDWIDTH = 1,
127 SURF_TRACE_CONNECT_KIND_LATENCY = 0
128 } e_surf_trace_connect_kind_t;
131 SURF_ACTOR_ON_FAILURE_DIE = 1,
132 SURF_ACTOR_ON_FAILURE_RESTART = 0
133 } e_surf_process_on_failure_t;
136 /** @ingroup m_datatypes_management_details
137 * @brief Type for any simgrid size
139 typedef unsigned long long sg_size_t;
141 /** @ingroup m_datatypes_management_details
142 * @brief Type for any simgrid offset
144 typedef long long sg_offset_t;
146 typedef unsigned long aid_t;
148 #endif /* SIMGRID_TYPES_H */