16 #ifndef IOX_POSH_CAPRO_SERVICE_DESCRIPTION_HPP
17 #define IOX_POSH_CAPRO_SERVICE_DESCRIPTION_HPP
19 #include "iceoryx_posh/iceoryx_posh_types.hpp"
20 #include "iceoryx_utils/cxx/helplets.hpp"
21 #include "iceoryx_utils/cxx/serialization.hpp"
22 #include "iceoryx_utils/cxx/string.hpp"
23 #include "iceoryx_utils/cxx/vector.hpp"
26 #include <initializer_list>
32 static constexpr uint16_t InvalidID = 0u;
33 static const IdString_t InvalidIDString{
"0"};
34 static constexpr uint16_t AnyService = 0xFFFFu;
35 static constexpr uint16_t AnyInstance = 0xFFFFu;
36 static constexpr uint16_t AnyEvent = 0xFFFFu;
37 static constexpr
char AnyServiceString[]{
"65535"};
38 static constexpr
char AnyInstanceString[]{
"65535"};
39 static constexpr
char AnyEventString[]{
"65535"};
40 static constexpr int32_t MAX_NUMBER_OF_CHARS = 64;
41 static constexpr
size_t CLASS_HASH_ELEMENT_COUNT{4u};
44 enum class Interfaces : uint16_t
68 constexpr
const char* INTERFACE_NAMES[] = {
"INTERNAL",
"ESOC",
"SOMEIP",
"AMQP",
"DDS",
"SIGNAL",
"MTA",
"ROS1",
"END"};
71 enum class Scope : uint16_t
78 constexpr
char ScopeTypeString[][MAX_NUMBER_OF_CHARS] = {
"WORLDWIDE",
"INTERNAL",
"INVALID"};
91 ClassHash(
const std::initializer_list<uint32_t>& values) noexcept;
92 uint32_t& operator[](iox::cxx::range<uint64_t, 0, CLASS_HASH_ELEMENT_COUNT - 1> index) noexcept;
93 const uint32_t& operator[](iox::cxx::range<uint64_t, 0, CLASS_HASH_ELEMENT_COUNT - 1> index)
const noexcept;
94 bool operator==(
const ClassHash& rhs)
const noexcept;
95 bool operator!=(
const ClassHash& rhs)
const noexcept;
98 uint32_t data[CLASS_HASH_ELEMENT_COUNT];
121 const IdString_t& f_instance,
122 const IdString_t& f_event,
123 ClassHash m_classHash = {0u, 0u, 0u, 0u},
124 Interfaces interfaceSource = Interfaces::INTERNAL) noexcept;
141 operator cxx::Serialization()
const;
148 bool isInternal() const noexcept;
150 void setInternal() noexcept;
162 uint16_t getServiceID() const noexcept;
163 uint16_t getEventID() const noexcept;
164 IdString_t getServiceIDString() const noexcept;
165 IdString_t getInstanceIDString() const noexcept;
166 IdString_t getEventIDString() const noexcept;
179 uint16_t m_serviceID;
183 uint16_t m_instanceID;
185 IdString_t m_serviceString;
187 IdString_t m_instanceString;
189 IdString_t m_eventString;
191 bool m_hasServiceOnlyDescription = false;
196 Scope m_scope{Scope::WORLDWIDE};
199 Interfaces m_interfaceSource{Interfaces::INTERNAL};
208 bool serviceMatch(
const ServiceDescription& first,
const ServiceDescription& second) noexcept;
class for the identification of a communication event including information on the service,...
Definition: service_description.hpp:86
ClassHash getClassHash() const noexcept
bool isValid() const noexcept
Returns true for valid ServiceDescription false for ServiceDescription that contains either of Invali...
Interfaces getSourceInterface() const noexcept
Returns the interface form where the service is coming from.
Scope getScope() noexcept
Returns the scope of a ServiceDescription.
bool operator==(const ServiceDescription &rhs) const
compare operator. If wildcards AnyService, AnyInstance or AnyEvent are used as integer IDs,...
bool operator<(const ServiceDescription &rhs) const
Uses the underlying m_**String compare method to provide an order. This is needed to use ServiceDescr...
ServiceDescription() noexcept
default C'tor
bool hasServiceOnlyDescription() const noexcept
Returns true if it contains a service description which does not have events, otherwise it returns fa...
ServiceDescription(const cxx::Serialization &f_serial) noexcept
construction of the capro service description using serialized strings
bool operator!=(const ServiceDescription &rhs) const
negation of compare operator.
uint16_t getInstanceID() const noexcept
Definition: service_description.hpp:29
Definition: service_description.hpp:89