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

This class represents a Universal Unique ID. More...

#include <Uuid.hpp>

Public Member Functions

 Uuid (void)
 Constructs an empty Uuid instance. More...
 
 Uuid (const Uuid &arg)
 The default copy constructor. More...
 
 Uuid (Uuid &&arg) noexcept
 The default move constructor. More...
 
Uuidoperator= (const Uuid &arg)
 THe default copy-assignment operator. More...
 
Uuidoperator= (Uuid &&arg) noexcept
 The default move-assignment operator. More...
 
 ~Uuid (void)
 The default destructor.
 
bool IsEmpty (void) const
 Determines if this instance is empty. More...
 
String ToString (void) const
 Returns the string representation of this Uuid. More...
 
size_t GetHashValue (void) const
 Returns the hash value of this Uuid. More...
 
void Clear (void)
 Empties this instance. More...
 
void CopyTo (byte *pData) const
 Copies the binary data of this Uuid to the supplied buffer. More...
 
void CopyLittleEndianTo (byte *pData) const
 Copies the binary data of this Uuid to the supplied buffer in little endian format. More...
 
Impl & GetImpl (void)
 For internal use only. More...
 
const Impl & GetImpl (void) const
 

Static Public Member Functions

static Uuid GetEmpty (void)
 Returns an empty Uuid. More...
 
static Uuid CreateNew (void)
 Creates a new unique Uuid. More...
 
static Uuid Create (const byte *pData)
 Creates a new unique Uuid from the given bytes. More...
 
static Uuid CreateFromLittleEndian (const byte *pData)
 Creates a new unique Uuid from the given bytes. More...
 
static Uuid Parse (const String &input)
 Creates a new Uuid by parsing the supplied string. More...
 
static bool TryParse (const String &input, Uuid &result)
 Tries to creates a new Uuid by parsing the supplied string. More...
 

Friends

ARP_EXPORT friend bool operator== (const Uuid &lhs, const Uuid &rhs) noexcept
 The equality operator compares 2 Uuids. More...
 
ARP_EXPORT friend bool operator!= (const Uuid &lhs, const Uuid &rhs) noexcept
 The inequality operator compares 2 Uuids. More...
 
ARP_EXPORT friend bool operator< (const Uuid &lhs, const Uuid &rhs) noexcept
 The less operator compares 2 Uuids. More...
 
ARP_EXPORT friend bool operator> (const Uuid &lhs, const Uuid &rhs) noexcept
 The greater operator compares 2 Uuids. More...
 
ARP_EXPORT friend bool operator<= (const Uuid &lhs, const Uuid &rhs) noexcept
 The less-or-equal operator compares 2 Uuids. More...
 
ARP_EXPORT friend bool operator>= (const Uuid &lhs, const Uuid &rhs) noexcept
 The greater-or-equal operator compares 2 Uuids. More...
 
ARP_EXPORT friend std::ostream & operator<< (std::ostream &os, const Uuid &id)
 The ostream operator is used for logging and string formatting. More...
 
ARP_EXPORT friend std::istream & operator>> (std::istream &is, Uuid &id)
 The istream operator is used for string parsing. More...
 

Detailed Description

This class represents a Universal Unique ID.

UUID is a standardized 128-bit format for unique string IDs.

Constructor & Destructor Documentation

◆ Uuid() [1/3]

Arp::System::Commons::Configuration::Uuid::Uuid ( void  )

Constructs an empty Uuid instance.

Constructs an empty (zero'ed) Uuid instance.

◆ Uuid() [2/3]

Arp::Base::Commons::Configuration::Uuid::Uuid ( const Uuid arg)
default

The default copy constructor.

Parameters
argThe argument to copy.

◆ Uuid() [3/3]

Arp::Base::Commons::Configuration::Uuid::Uuid ( Uuid &&  arg)
defaultnoexcept

The default move constructor.

Parameters
argThe argument to move.

Member Function Documentation

◆ Clear()

void Arp::System::Commons::Configuration::Uuid::Clear ( void  )

Empties this instance.

Cleas this instance to an empty/zero'ed uuid.

◆ CopyLittleEndianTo()

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

Copies the binary data of this Uuid to the supplied buffer in little endian format.

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

Parameters
pDataThe buffer to copy the binary data to in little endian format.
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 data of this Uuid to the supplied buffer.

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

Parameters
pDataThe buffer to copy the binary data to.
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.

◆ Create()

Uuid Arp::System::Commons::Configuration::Uuid::Create ( const byte *  pData)
static

Creates a new unique Uuid from the given bytes.

Creates a unique id from the as argument passed binary representation in big endian.

Parameters
pBufferThe bytes to create the Uuid from.
Returns
A new Uuid initialized by the given bytes.

◆ CreateFromLittleEndian()

Uuid Arp::System::Commons::Configuration::Uuid::CreateFromLittleEndian ( const byte *  pData)
static

Creates a new unique Uuid from the given bytes.

Creates a unique id from the as argument passed binary representation in little endian.

Parameters
pBufferThe bytes in little endian format to create the Uuid from.
Returns
A new Uuid initialized by the given bytes.

◆ CreateNew()

Uuid Arp::System::Commons::Configuration::Uuid::CreateNew ( void  )
static

Creates a new unique Uuid.

Creates a new unique id.

Returns
A new unique Uuid.

◆ GetEmpty()

Uuid Arp::Base::Commons::Configuration::Uuid::GetEmpty ( void  )
static

Returns an empty Uuid.

Returns
An empty Uuid.

◆ GetHashValue()

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

Returns the hash value of this Uuid.

Gets the hash value for this uuid.

Returns
The hash value of this Uuid.
Returns
The hash value of this uuid.

◆ GetImpl()

const Uuid::Impl & Arp::Base::Commons::Configuration::Uuid::GetImpl ( void  )

For internal use only.

Returns
The impl instance.

◆ IsEmpty()

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

Determines if this instance is empty.

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

Returns
true if this instance is empty, otherwise false.
Returns
true if it is empty, otherwise false.

◆ operator=() [1/2]

Uuid & Arp::Base::Commons::Configuration::Uuid::operator= ( const Uuid arg)
default

THe default copy-assignment operator.

Parameters
argThe argument to copy.
Returns
This instance.

◆ operator=() [2/2]

Uuid & Arp::Base::Commons::Configuration::Uuid::operator= ( Uuid &&  arg)
defaultnoexcept

The default move-assignment operator.

Parameters
argThe argument to move.
Returns
This instance.

◆ Parse()

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

Creates a new Uuid by parsing the supplied string.

Creates a new unique id from the given input string.

Parameters
inputThe string to parse.
Returns
A new Uuid initialized by the given string.
Exceptions
ArgumentExceptionIf the input string does not represent a valid Uuid.
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

Returns the string representation of this Uuid.

Creates a string representation of this uuid.

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

◆ TryParse()

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

Tries to creates a new Uuid by parsing the supplied string.

Creates a new unique id.

Parameters
inputThe string to parse.
resultThe resulting Uuid.
Returns
true if the string is a valid Uuid string, otherwise false.
Parameters
inputThe input string to parse
resultThe resulting uuid.
Returns
true on success, otherwise false.
See also
Parse

For supported formats

Friends And Related Function Documentation

◆ operator!=

ARP_EXPORT friend bool operator!= ( const Uuid lhs,
const Uuid rhs 
)
friend

The inequality operator compares 2 Uuids.

Parameters
lhsThe left argument to compare to the right argument.
rhsThe right argument to compare to the left argument.
Returns
true if the arguments are not equal, otherwise false.

◆ operator<

ARP_EXPORT friend bool operator< ( const Uuid lhs,
const Uuid rhs 
)
friend

The less operator compares 2 Uuids.

Parameters
lhsThe left argument to compare to the right argument.
rhsThe right argument to compare to the left argument.
Returns
true if the left arguments is less than the right argument, otherwise false.

◆ operator<<

ARP_EXPORT friend std::ostream & operator<< ( std::ostream &  os,
const Uuid id 
)
friend

The ostream operator is used for logging and string formatting.

Parameters
osThe stream to write to.
urlThe Uuid to write.
Returns
The as argument passed stream os .

◆ operator<=

ARP_EXPORT friend bool operator<= ( const Uuid lhs,
const Uuid rhs 
)
friend

The less-or-equal operator compares 2 Uuids.

Parameters
lhsThe left argument to compare to the right argument.
rhsThe right argument to compare to the left argument.
Returns
true if the left arguments is less or equal than the right argument, otherwise false.

◆ operator==

ARP_EXPORT friend bool operator== ( const Uuid lhs,
const Uuid rhs 
)
friend

The equality operator compares 2 Uuids.

Parameters
lhsThe left argument to compare to the right argument.
rhsThe right argument to compare to the left argument.
Returns
true if the arguments are equal, otherwise false.

◆ operator>

ARP_EXPORT friend bool operator> ( const Uuid lhs,
const Uuid rhs 
)
friend

The greater operator compares 2 Uuids.

Parameters
lhsThe left argument to compare to the right argument.
rhsThe right argument to compare to the left argument.
Returns
true if the left arguments is greater than the right argument, otherwise false.

◆ operator>=

ARP_EXPORT friend bool operator>= ( const Uuid lhs,
const Uuid rhs 
)
friend

The greater-or-equal operator compares 2 Uuids.

Parameters
lhsThe left argument to compare to the right argument.
rhsThe right argument to compare to the left argument.
Returns
true if the left arguments is greater or equal than the right argument, otherwise false.

◆ operator>>

ARP_EXPORT friend std::istream & operator>> ( std::istream &  is,
Uuid id 
)
friend

The istream operator is used for string parsing.

Parameters
isThe stream to read from.
urlThe Uuid to read.
Returns
The as argument passed stream is .

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