19#ifndef FASTDDS_RTPS_COMMON__GUIDPREFIX_T_HPP
20#define FASTDDS_RTPS_COMMON__GUIDPREFIX_T_HPP
22#include <fastdds/fastdds_dll.hpp>
23#include <fastdds/rtps/common/Types.hpp>
38 static constexpr unsigned int size = 12;
44 memset(value, 0, size);
90#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
100 return (memcmp(value, prefix.
value, size) == 0);
111 return (memcmp(value, prefix.
value, size) != 0);
122 return std::memcmp(value, prefix.
value, size) < 0;
139 return std::memcmp(prefix1.
value, prefix2.
value, size);
148 std::ostream& output,
151 std::stringstream ss;
153 char old_fill = ss.fill(
'0');
154 for (uint8_t i = 0; i < 11; ++i)
156 ss << std::setw(2) << (int)guiP.
value[i] <<
".";
158 ss << std::setw(2) << (int)guiP.
value[11];
161 return output << ss.str();
168 std::istream::sentry s(input);
174 std::ios_base::iostate excp_mask = input.exceptions();
178 input.exceptions(excp_mask | std::ios_base::failbit | std::ios_base::badbit);
179 input >> std::hex >> hex;
183 input.setstate(std::ios_base::failbit);
188 for (
int i = 1; i < 12; ++i)
190 input >> point >> hex;
191 if ( point !=
'.' || hex > 255 )
193 input.setstate(std::ios_base::failbit);
200 catch (std::ios_base::failure& )
205 input.exceptions(excp_mask);
std::istream & operator>>(std::istream &input, EntityId_t &enP)
Definition EntityId_t.hpp:289
std::ostream & operator<<(std::ostream &output, BuiltinTransports transports)
Definition BuiltinTransports.hpp:117
unsigned char octet
Definition Types.hpp:83
const GuidPrefix_t c_GuidPrefix_Unknown
Definition GuidPrefix_t.hpp:145
Structure GuidPrefix_t, Guid Prefix of GUID_t.
Definition GuidPrefix_t.hpp:37
bool is_from_this_host() const
Checks whether this guid prefix is from a (Fast-DDS) entity created on this host (from where this met...
GuidPrefix_t()
Default constructor. Set the Guid prefix to 0.
Definition GuidPrefix_t.hpp:42
bool is_from_this_process() const
Checks whether this guid prefix is from a (Fast-DDS) entity created on this host and process (from wh...
static int cmp(const GuidPrefix_t &prefix1, const GuidPrefix_t &prefix2)
Guid Prefix compare static method.
Definition GuidPrefix_t.hpp:135
bool is_on_same_host_as(const GuidPrefix_t &other_guid_prefix) const
Checks whether this guid prefix is from an entity on the same host as another guid prefix.
bool is_on_same_process_as(const GuidPrefix_t &other_guid_prefix) const
Checks whether this guid prefix is for an entity on the same host and process as another guid prefix.
octet value[size]
Definition GuidPrefix_t.hpp:39
static GuidPrefix_t unknown()
Definition GuidPrefix_t.hpp:85