17 #ifndef IOX_POSH_ICEORYX_POSH_TYPES_HPP
18 #define IOX_POSH_ICEORYX_POSH_TYPES_HPP
20 #include "iceoryx_hoofs/cxx/method_callback.hpp"
21 #include "iceoryx_hoofs/cxx/string.hpp"
22 #include "iceoryx_hoofs/cxx/variant_queue.hpp"
23 #include "iceoryx_hoofs/cxx/vector.hpp"
24 #include "iceoryx_hoofs/internal/posix_wrapper/ipc_channel.hpp"
25 #include "iceoryx_hoofs/internal/units/duration.hpp"
26 #include "iceoryx_hoofs/log/logstream.hpp"
27 #include "iceoryx_hoofs/platform/platform_settings.hpp"
28 #include "iceoryx_posh/iceoryx_posh_deployment.hpp"
39 class PublisherPortRouDi;
40 class PublisherPortUser;
41 class SubscriberPortRouDi;
42 class SubscriberPortUser;
46 class ServiceDescription;
49 using PublisherPortRouDiType = iox::popo::PublisherPortRouDi;
50 using PublisherPortUserType = iox::popo::PublisherPortUser;
51 using SubscriberPortRouDiType = iox::popo::SubscriberPortRouDi;
52 using SubscriberPortUserType = iox::popo::SubscriberPortUser;
54 using SubscriberPortType = iox::build::CommunicationPolicy;
58 constexpr uint32_t MAX_PUBLISHERS = build::IOX_MAX_PUBLISHERS;
59 constexpr uint32_t MAX_SUBSCRIBERS_PER_PUBLISHER = build::IOX_MAX_SUBSCRIBERS_PER_PUBLISHER;
60 constexpr uint32_t MAX_CHUNKS_ALLOCATED_PER_PUBLISHER_SIMULTANEOUSLY =
61 build::IOX_MAX_CHUNKS_ALLOCATED_PER_PUBLISHER_SIMULTANEOUSLY;
62 constexpr uint64_t MAX_PUBLISHER_HISTORY = build::IOX_MAX_PUBLISHER_HISTORY;
64 constexpr uint32_t MAX_SUBSCRIBERS = build::IOX_MAX_SUBSCRIBERS;
65 constexpr uint32_t MAX_CHUNKS_HELD_PER_SUBSCRIBER_SIMULTANEOUSLY =
66 build::IOX_MAX_CHUNKS_HELD_PER_SUBSCRIBER_SIMULTANEOUSLY;
67 constexpr uint32_t MAX_SUBSCRIBER_QUEUE_CAPACITY = MAX_CHUNKS_HELD_PER_SUBSCRIBER_SIMULTANEOUSLY;
72 constexpr uint32_t PUBLISHERS_RESERVED_FOR_INTROSPECTION = 5;
73 constexpr uint32_t PUBLISHERS_RESERVED_FOR_SERVICE_REGISTRY = 1;
74 constexpr uint32_t NUMBER_OF_INTERNAL_PUBLISHERS =
75 PUBLISHERS_RESERVED_FOR_INTROSPECTION + PUBLISHERS_RESERVED_FOR_SERVICE_REGISTRY;
82 constexpr uint32_t MAX_INTERFACE_NUMBER = build::IOX_MAX_INTERFACE_NUMBER;
83 constexpr uint32_t MAX_INTERFACE_CAPRO_FIFO_SIZE = MAX_PUBLISHERS;
84 constexpr uint32_t MAX_CHANNEL_NUMBER = MAX_PUBLISHERS + MAX_SUBSCRIBERS;
85 constexpr uint32_t MAX_GATEWAY_SERVICES = 2 * MAX_CHANNEL_NUMBER;
87 constexpr uint32_t MAX_CLIENTS = build::IOX_MAX_SUBSCRIBERS;
88 constexpr uint32_t MAX_REQUESTS_ALLOCATED_SIMULTANEOUSLY = 4U;
89 constexpr uint32_t MAX_RESPONSES_PROCESSED_SIMULTANEOUSLY = 16U;
90 constexpr uint32_t MAX_RESPONSE_QUEUE_CAPACITY = 16U;
92 constexpr uint32_t MAX_SERVERS = build::IOX_MAX_PUBLISHERS;
93 constexpr uint32_t MAX_CLIENTS_PER_SERVER = 256U;
94 constexpr uint32_t MAX_REQUESTS_PROCESSED_SIMULTANEOUSLY = 4U;
95 constexpr uint32_t MAX_RESPONSES_ALLOCATED_SIMULTANEOUSLY = MAX_REQUESTS_PROCESSED_SIMULTANEOUSLY;
96 constexpr uint32_t MAX_REQUEST_QUEUE_CAPACITY = 1024;
100 using WaitSetIsConditionSatisfiedCallback = cxx::ConstMethodCallback<bool>;
102 constexpr uint32_t MAX_NUMBER_OF_CONDITION_VARIABLES = 1024U;
104 constexpr uint32_t MAX_NUMBER_OF_NOTIFIERS = build::IOX_MAX_NUMBER_OF_NOTIFIERS;
107 constexpr uint32_t MAX_NUMBER_OF_ATTACHMENTS_PER_WAITSET = MAX_NUMBER_OF_NOTIFIERS;
108 constexpr uint32_t MAX_NUMBER_OF_EVENTS_PER_LISTENER = MAX_NUMBER_OF_NOTIFIERS;
112 constexpr uint32_t MAX_NUMBER_OF_MEMPOOLS = 32U;
113 constexpr uint32_t MAX_SHM_SEGMENTS = 100U;
115 constexpr uint32_t MAX_NUMBER_OF_MEMORY_PROVIDER = 8U;
116 constexpr uint32_t MAX_NUMBER_OF_MEMORY_BLOCKS_PER_MEMORY_PROVIDER = 64U;
118 constexpr uint32_t CHUNK_DEFAULT_USER_PAYLOAD_ALIGNMENT{8U};
119 constexpr uint32_t CHUNK_NO_USER_HEADER_SIZE{0U};
120 constexpr uint32_t CHUNK_NO_USER_HEADER_ALIGNMENT{1U};
123 constexpr uint32_t ROUDI_MAX_MESSAGES = 5U;
124 constexpr uint32_t ROUDI_MESSAGE_SIZE = 512U;
125 constexpr uint32_t APP_MAX_MESSAGES = 5U;
126 constexpr uint32_t APP_MESSAGE_SIZE = 512U;
130 constexpr uint32_t MAX_PROCESS_NUMBER = 300U;
133 constexpr uint32_t SERVICE_REGISTRY_CAPACITY = MAX_PUBLISHERS + MAX_SERVERS;
134 constexpr uint32_t MAX_FINDSERVICE_RESULT_SIZE = SERVICE_REGISTRY_CAPACITY;
136 constexpr
const char SERVICE_DISCOVERY_SERVICE_NAME[] =
"ServiceDiscovery";
137 constexpr
const char SERVICE_DISCOVERY_INSTANCE_NAME[] =
"RouDi_ID";
138 constexpr
const char SERVICE_DISCOVERY_EVENT_NAME[] =
"ServiceRegistry";
142 using ServiceContainer = iox::cxx::vector<capro::ServiceDescription, MAX_FINDSERVICE_RESULT_SIZE>;
146 constexpr uint32_t MAX_NODE_NUMBER = 1000U;
147 constexpr uint32_t MAX_NODE_PER_PROCESS = 50U;
149 constexpr uint32_t MAX_RUNTIME_NAME_LENGTH = MAX_IPC_CHANNEL_NAME_LENGTH;
152 static_assert(MAX_PROCESS_NUMBER * MAX_NODE_PER_PROCESS > MAX_NODE_NUMBER,
"Invalid configuration for nodes");
154 enum class SubscribeState : uint32_t
159 UNSUBSCRIBE_REQUESTED,
163 enum class ConnectionState : uint32_t
168 DISCONNECT_REQUESTED,
175 inline constexpr
const char* asStringLiteral(ConnectionState value) noexcept;
181 inline std::ostream& operator<<(std::ostream& stream, ConnectionState value) noexcept;
187 inline log::LogStream& operator<<(log::LogStream& stream, ConnectionState value) noexcept;
192 static constexpr uint32_t MAX_QUEUES = MAX_SUBSCRIBERS_PER_PUBLISHER;
193 static constexpr uint64_t MAX_HISTORY_CAPACITY = MAX_PUBLISHER_HISTORY;
199 static constexpr uint64_t MAX_QUEUE_CAPACITY = MAX_SUBSCRIBER_QUEUE_CAPACITY;
203 using RuntimeName_t = cxx::string<MAX_RUNTIME_NAME_LENGTH>;
205 using NodeName_t = cxx::string<100>;
207 using ShmName_t = cxx::string<128>;
212 using IdString_t = cxx::string<100>;
219 using ConfigFilePathString_t = cxx::string<1024>;
221 constexpr
const char ROUDI_LOCK_NAME[] =
"iox-unique-roudi";
222 constexpr
const char IPC_CHANNEL_ROUDI_NAME[] =
"roudi";
228 constexpr uint16_t DEFAULT_UNIQUE_ROUDI_ID{0U};
231 using namespace units::duration_literals;
232 constexpr units::Duration PROCESS_DEFAULT_KILL_DELAY = 45_s;
233 constexpr units::Duration PROCESS_TERMINATED_CHECK_INTERVAL = 250_ms;
234 constexpr units::Duration DISCOVERY_INTERVAL = 100_ms;
248 iox::log::LogStream& operator<<(iox::log::LogStream& logstream,
const MonitoringMode& mode) noexcept;
253 using SequenceNumber_t = std::uint64_t;
254 using BaseClock_t = std::chrono::steady_clock;
259 using DurationNs_t = std::chrono::duration<std::int64_t, std::nano>;
260 using TimePointNs_t = std::chrono::time_point<BaseClock_t, DurationNs_t>;
265 using namespace units::duration_literals;
266 constexpr units::Duration PROCESS_WAITING_FOR_ROUDI_TIMEOUT = 60_s;
267 constexpr units::Duration PROCESS_KEEP_ALIVE_INTERVAL = 3 * roudi::DISCOVERY_INTERVAL;
268 constexpr units::Duration PROCESS_KEEP_ALIVE_TIMEOUT = 5 * PROCESS_KEEP_ALIVE_INTERVAL;
273 static const uint64_t COMMIT_ID_STRING_SIZE = 12U;
274 using CommitIdString_t = cxx::string<COMMIT_ID_STRING_SIZE>;
275 static const uint64_t BUILD_DATE_STRING_SIZE = 36U;
276 using BuildDateString_t = cxx::string<BUILD_DATE_STRING_SIZE>;
281 #include "iceoryx_posh/iceoryx_posh_types.inl"
MonitoringMode
Controls process alive monitoring. Upon timeout, a monitored process is removed and its resources are...
Definition: iceoryx_posh_types.hpp:243
constexpr const char SHM_NAME[]
shared memory segment for the iceoryx management data
Definition: iceoryx_posh_types.hpp:225
Definition: iceoryx_posh_types.hpp:191
Definition: iceoryx_posh_types.hpp:198