17 #ifndef IOX_POSH_CAPRO_SERVICE_DESCRIPTION_HPP
18 #define IOX_POSH_CAPRO_SERVICE_DESCRIPTION_HPP
20 #include "iceoryx_hoofs/cxx/serialization.hpp"
21 #include "iceoryx_hoofs/cxx/string.hpp"
22 #include "iceoryx_hoofs/cxx/vector.hpp"
23 #include "iceoryx_hoofs/log/logstream.hpp"
24 #include "iceoryx_posh/iceoryx_posh_types.hpp"
27 #include <initializer_list>
34 using Wildcard_t = iox::cxx::nullopt_t;
35 constexpr Wildcard_t Wildcard;
37 static constexpr int32_t MAX_NUMBER_OF_CHARS = 64;
38 static constexpr
size_t CLASS_HASH_ELEMENT_COUNT{4U};
41 enum class Interfaces : uint16_t
65 constexpr
const char* INTERFACE_NAMES[] = {
"INTERNAL",
"ESOC",
"SOMEIP",
"AMQP",
"DDS",
"SIGNAL",
"MTA",
"ROS1",
"END"};
68 enum class Scope : uint16_t
75 constexpr
char ScopeTypeString[][MAX_NUMBER_OF_CHARS] = {
"WORLDWIDE",
"INTERNAL",
"INVALID"};
86 ClassHash(
const std::initializer_list<uint32_t>& values) noexcept;
87 uint32_t& operator[](iox::cxx::range<uint64_t, 0, CLASS_HASH_ELEMENT_COUNT - 1> index) noexcept;
88 const uint32_t& operator[](iox::cxx::range<uint64_t, 0, CLASS_HASH_ELEMENT_COUNT - 1> index)
const noexcept;
89 bool operator==(
const ClassHash& rhs)
const noexcept;
90 bool operator!=(
const ClassHash& rhs)
const noexcept;
93 uint32_t data[CLASS_HASH_ELEMENT_COUNT];
104 const IdString_t& instance,
105 const IdString_t& event,
106 ClassHash m_classHash = {0U, 0U, 0U, 0U},
107 Interfaces interfaceSource = Interfaces::INTERNAL) noexcept;
123 explicit operator cxx::Serialization() const noexcept;
132 bool isLocal() const noexcept;
134 void setLocal() noexcept;
142 const IdString_t& getInstanceIDString() const noexcept;
143 const IdString_t& getEventIDString() const noexcept;
156 IdString_t m_serviceString;
158 IdString_t m_instanceString;
160 IdString_t m_eventString;
166 Scope m_scope{Scope::WORLDWIDE};
169 Interfaces m_interfaceSource{Interfaces::INTERNAL};
178 bool serviceMatch(
const ServiceDescription& first,
const ServiceDescription& second) noexcept;
184 std::ostream& operator<<(std::ostream& stream,
const ServiceDescription& service) noexcept;
190 log::LogStream& operator<<(log::LogStream& stream,
const ServiceDescription& service) noexcept;
class for the identification of a communication event including information on the service,...
Definition: service_description.hpp:81
ClassHash getClassHash() const noexcept
const IdString_t & getServiceIDString() const noexcept
Interfaces getSourceInterface() const noexcept
Returns the interface form where the service is coming from.
bool operator<(const ServiceDescription &rhs) const noexcept
Uses the underlying m_**String compare method to provide an order. This is needed to use ServiceDescr...
bool operator==(const ServiceDescription &rhs) const noexcept
compare operator.
ServiceDescription() noexcept
default C'tor
static cxx::expected< ServiceDescription, cxx::Serialization::Error > deserialize(const cxx::Serialization &serialized) noexcept
de-serialization of a ServiceDescription.
Scope getScope() const noexcept
Returns the scope of a ServiceDescription.
bool operator!=(const ServiceDescription &rhs) const noexcept
negation of compare operator.
Definition: service_description.hpp:84