8 #include <boost/uuid/uuid.hpp> 11 namespace Arp {
namespace System {
namespace Commons {
namespace Configuration
21 using BasicUuid = boost::uuids::uuid;
33 ~Uuid(
void) =
default;
36 friend bool operator==(
const Uuid& lhs,
const Uuid& rhs)noexcept;
37 friend bool operator!=(
const Uuid& lhs,
const Uuid& rhs)noexcept;
38 friend bool operator<(
const Uuid& lhs,
const Uuid& rhs)noexcept;
39 friend bool operator>(
const Uuid& lhs,
const Uuid& rhs)noexcept;
40 friend bool operator<=(
const Uuid& lhs,
const Uuid& rhs)noexcept;
41 friend bool operator>=(
const Uuid& lhs,
const Uuid& rhs)noexcept;
44 friend std::ostream& operator<<(std::ostream& os,
const Uuid&
id);
45 friend std::istream& operator>>(std::istream& is,
Uuid&
id);
115 return basicId.is_nil();
119 inline bool operator==(
const Uuid& lhs,
const Uuid& rhs) noexcept
121 return lhs.basicId == rhs.basicId;
124 inline bool operator!=(
const Uuid& lhs,
const Uuid& rhs) noexcept
126 return lhs.basicId != rhs.basicId;
129 inline bool operator<(
const Uuid& lhs,
const Uuid& rhs) noexcept
131 return lhs.basicId < rhs.basicId;
134 inline bool operator>(
const Uuid& lhs,
const Uuid& rhs) noexcept
136 return lhs.basicId > rhs.basicId;
139 inline bool operator<=(
const Uuid& lhs,
const Uuid& rhs) noexcept
141 return lhs.basicId <= rhs.basicId;
144 inline bool operator>=(
const Uuid& lhs,
const Uuid& rhs) noexcept
146 return lhs.basicId >= rhs.basicId;
158 struct hash<
Arp::System::Commons::Configuration::Uuid>
162 typedef size_t result_type;
165 result_type operator()(
const argument_type& key)
const Uuid(void)
Constructs an empty (zero'ed) Uuid instance.
static Uuid CreateNew(void)
Creates a new unique id.
bool IsEmpty(void) const
Checks if this uuid is emtpy (zero'ed).
Definition: Uuid.hpp:113
Namespace of the C++ standard library
Uuid & operator=(const Uuid &arg)=default
Assignment operator.
size_t GetHashValue(void) const
Gets the hash value for this uuid.
String ToString(void) const
Creates a string representation of this uuid.
void CopyLittleEndianTo(byte *pBuffer) const
Copies the binary representation to the given buffer in little endian.
Root namespace for the PLCnext API
~Uuid(void)=default
Destructs this instance and frees all resources.
static bool TryParse(const String &input, Uuid &result)
Creates a new unique id.
void Clear(void)
Cleas this instance to an empty/zero'ed uuid.
static Uuid Parse(const String &input)
Creates a new unique id from the given input string.
static Uuid CreateFromLittleEndian(const byte *pBuffer)
Creates a unique id from the as argument passed binary representation in little endian.
System components used by the System, Device, Plc or Io domains.
static Uuid Empty(void)
Returns an empty (zero'ed) Uuid instance.
static Uuid Create(const byte *pBuffer)
Creates a unique id from the as argument passed binary representation in big endian.
This is a small immutable wrapper around the boost::uuids::uuid class and represents a universal uniq...
Definition: Uuid.hpp:18
void CopyTo(byte *pBuffer) const
Copies the binary representation to the given buffer in big endian.
unsigned char byte
The Arp character type.
Definition: PrimitiveTypes.hpp:23