PLCnext API Documentation 23.6.0.37
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
Arp::System::Commons::Configuration::Uuid Class Reference

This is a small immutable wrapper around the boost::uuids::uuid class and represents a universal unique id. More...

#include <Uuid.hpp>

Public Types

using BasicUuid = boost::uuids::uuid
 

Public Member Functions

 Uuid (void)
 Constructs an empty (zero'ed) Uuid instance.
 
 Uuid (const Uuid &arg)=default
 Copy constructor.
 
 Uuid (Uuid &&arg)=default
 Move constructor.
 
Uuidoperator= (const Uuid &arg)=default
 Assignment operator.
 
 ~Uuid (void)=default
 Destructs this instance and frees all resources.
 
bool IsEmpty (void) const
 Checks if this uuid is emtpy (zero'ed). More...
 
String ToString (void) const
 Creates a string representation of this uuid. More...
 
size_t GetHashValue (void) const
 Gets the hash value for this uuid. More...
 
void Clear (void)
 Cleas this instance to an empty/zero'ed uuid.
 
void CopyTo (byte *pBuffer) const
 Copies the binary representation to the given buffer in big endian. More...
 
void CopyLittleEndianTo (byte *pBuffer) const
 Copies the binary representation to the given buffer in little endian. More...
 

Static Public Member Functions

static Uuid Empty (void)
 Returns an empty (zero'ed) Uuid instance.
 
static Uuid CreateNew (void)
 Creates a new unique id.
 
static Uuid Create (const byte *pBuffer)
 Creates a unique id from the as argument passed binary representation in big endian.
 
static Uuid CreateFromLittleEndian (const byte *pBuffer)
 Creates a unique id from the as argument passed binary representation in little endian.
 
static Uuid Parse (const String &input)
 Creates a new unique id from the given input string. More...
 
static bool TryParse (const String &input, Uuid &result)
 Creates a new unique id. More...
 

Friends

bool operator== (const Uuid &lhs, const Uuid &rhs) noexcept
 
bool operator!= (const Uuid &lhs, const Uuid &rhs) noexcept
 
bool operator< (const Uuid &lhs, const Uuid &rhs) noexcept
 
bool operator> (const Uuid &lhs, const Uuid &rhs) noexcept
 
bool operator<= (const Uuid &lhs, const Uuid &rhs) noexcept
 
bool operator>= (const Uuid &lhs, const Uuid &rhs) noexcept
 
std::ostream & operator<< (std::ostream &os, const Uuid &id)
 
std::istream & operator>> (std::istream &is, Uuid &id)
 

Detailed Description

This is a small immutable wrapper around the boost::uuids::uuid class and represents a universal unique id.

See https://www.boost.org/doc/libs/1_70_0/libs/uuid/doc/uuid.html#boost/uuid/uuid.hpp

Member Function Documentation

◆ CopyLittleEndianTo()

void Arp::System::Commons::Configuration::Uuid::CopyLittleEndianTo ( byte pBuffer) const

Copies the binary representation to the given buffer in little endian.

Parameters
pBufferThe buffer to be filled in little endian format.The count of copied bytes is always 16, thus the as argument passed buffer should have at least a size of 16.

◆ CopyTo()

void Arp::System::Commons::Configuration::Uuid::CopyTo ( byte pBuffer) const

Copies the binary representation to the given buffer in big endian.

Parameters
pBufferThe buffer to be filled in big endian format.The count of copied bytes is always 16, thus the as argument passed buffer should have at least a size of 16.

◆ GetHashValue()

size_t Arp::System::Commons::Configuration::Uuid::GetHashValue ( void  ) const

Gets the hash value for this uuid.

Returns
The hash value of this uuid.

◆ IsEmpty()

bool Arp::System::Commons::Configuration::Uuid::IsEmpty ( void  ) const
inline

Checks if this uuid is emtpy (zero'ed).

Returns
true if it is empty, otherwise false.

◆ Parse()

static Uuid Arp::System::Commons::Configuration::Uuid::Parse ( const String input)
static

Creates a new unique id from the given input string.

Parameters
inputThe input string to parse
Exceptions
ArgumentExceptionIf the input string has not a valid UUID format.

The following string formats a supported xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} {xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}

◆ ToString()

String Arp::System::Commons::Configuration::Uuid::ToString ( void  ) const

Creates a string representation of this uuid.

Returns
A string of this uuid in the format 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'.

◆ TryParse()

static bool Arp::System::Commons::Configuration::Uuid::TryParse ( const String input,
Uuid result 
)
static

Creates a new unique id.

Parameters
inputThe input string to parse
resultThe resulting uuid.
Returns
true on success, otherwise false.
See also
Parse

For supported formats


The documentation for this class was generated from the following file: