Direct-BT v3.3.0-1-gc2d430c
Direct-BT - Direct Bluetooth Programming.
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
jau::uuid_t Class Referenceabstract

#include <uuid.hpp>

Inheritance diagram for jau::uuid_t:
Collaboration diagram for jau::uuid_t:

Public Types

enum class  TypeSize : jau::nsize_t { UUID16_SZ =2 , UUID32_SZ =4 , UUID128_SZ =16 }
 Underlying integer value present octet count. More...
 

Public Member Functions

 uuid_t (const uuid_t &o) noexcept=default
 
 uuid_t (uuid_t &&o) noexcept=default
 
virtual ~uuid_t () noexcept=default
 
std::unique_ptr< uuid_tclone () const noexcept
 
virtual const uint8_t * data () const noexcept=0
 returns the pointer to the uuid data of size getTypeSize() More...
 
bool equivalent (uuid_t const &o) const noexcept
 Relaxed equality operator. More...
 
TypeSize getTypeSize () const noexcept
 
jau::nsize_t getTypeSizeInt () const noexcept
 
std::string getTypeSizeString () const noexcept
 
bool operator!= (uuid_t const &o) const noexcept
 Strict not-equal operator. More...
 
uuid_toperator= (const uuid_t &o) noexcept=default
 
uuid_toperator= (uuid_t &&o) noexcept=default
 
bool operator== (uuid_t const &o) const noexcept
 Strict equality operator. More...
 
virtual jau::nsize_t put (uint8_t *const buffer, lb_endian_t const le_or_be) const noexcept=0
 
virtual std::string toString () const noexcept=0
 Returns the string representation in BE network order, i.e. More...
 
uuid128_t toUUID128 (uuid128_t const &base_uuid=BT_BASE_UUID, jau::nsize_t const uuid32_le_octet_index=12) const noexcept
 
virtual std::string toUUID128String (uuid128_t const &base_uuid=BT_BASE_UUID, jau::nsize_t const le_octet_index=12) const noexcept=0
 Returns the uuid128_t string representation in BE network order, i.e. More...
 

Static Public Member Functions

static std::unique_ptr< uuid_tcreate (const std::string &str)
 
static std::unique_ptr< uuid_tcreate (TypeSize const t, uint8_t const *const buffer, lb_endian_t const le_or_be)
 
static std::string getTypeSizeString (const TypeSize v) noexcept
 
static constexpr jau::nsize_t number (const TypeSize rhs) noexcept
 
static TypeSize toTypeSize (const jau::nsize_t size)
 

Protected Member Functions

 uuid_t (TypeSize const type_)
 

Detailed Description

Definition at line 57 of file uuid.hpp.

Member Enumeration Documentation

◆ TypeSize

enum class jau::uuid_t::TypeSize : jau::nsize_t
strong

Underlying integer value present octet count.

Enumerator
UUID16_SZ 
UUID32_SZ 
UUID128_SZ 

Definition at line 60 of file uuid.hpp.

Constructor & Destructor Documentation

◆ uuid_t() [1/3]

jau::uuid_t::uuid_t ( TypeSize const  type_)
inlineprotected

Definition at line 72 of file uuid.hpp.

◆ ~uuid_t()

virtual jau::uuid_t::~uuid_t ( )
virtualdefaultnoexcept

◆ uuid_t() [2/3]

jau::uuid_t::uuid_t ( const uuid_t o)
defaultnoexcept

◆ uuid_t() [3/3]

jau::uuid_t::uuid_t ( uuid_t &&  o)
defaultnoexcept

Member Function Documentation

◆ number()

static constexpr jau::nsize_t jau::uuid_t::number ( const TypeSize  rhs)
inlinestaticconstexprnoexcept

Definition at line 63 of file uuid.hpp.

Here is the caller graph for this function:

◆ getTypeSizeString() [1/2]

std::string uuid_t::getTypeSizeString ( const TypeSize  v)
staticnoexcept

Definition at line 38 of file uuid.cpp.

◆ toTypeSize()

uuid_t::TypeSize uuid_t::toTypeSize ( const jau::nsize_t  size)
static

Definition at line 47 of file uuid.cpp.

Here is the caller graph for this function:

◆ create() [1/2]

std::unique_ptr< uuid_t > uuid_t::create ( TypeSize const  t,
uint8_t const *const  buffer,
lb_endian_t const  le_or_be 
)
static
Examples
dbt_scanner10.cpp.

Definition at line 56 of file uuid.cpp.

Here is the caller graph for this function:

◆ create() [2/2]

std::unique_ptr< uuid_t > uuid_t::create ( const std::string &  str)
static

Definition at line 66 of file uuid.cpp.

◆ operator=() [1/2]

uuid_t & jau::uuid_t::operator= ( const uuid_t o)
defaultnoexcept

◆ operator=() [2/2]

uuid_t & jau::uuid_t::operator= ( uuid_t &&  o)
defaultnoexcept

◆ clone()

std::unique_ptr< uuid_t > uuid_t::clone ( ) const
noexcept

Definition at line 84 of file uuid.cpp.

Here is the caller graph for this function:

◆ operator==()

bool uuid_t::operator== ( uuid_t const &  o) const
noexcept

Strict equality operator.

Only returns true if type and value are equal.

Parameters
oother comparison argument
Returns
true if equal, otherwise false.

Definition at line 94 of file uuid.cpp.

◆ operator!=()

bool jau::uuid_t::operator!= ( uuid_t const &  o) const
inlinenoexcept

Strict not-equal operator.

Returns true if type and/or value are not equal.

Parameters
oother comparison argument
Returns
true if equal, otherwise false.

Definition at line 106 of file uuid.hpp.

◆ equivalent()

bool uuid_t::equivalent ( uuid_t const &  o) const
noexcept

Relaxed equality operator.

Returns true if both uuid values are equivalent.

If their uuid_t type differs, i.e. their TypeSize, both values will be transformed to uuid128_t before comparison.

Potential uuid128_t conversion is performed using toUUDI128(), placing the sub-uuid at index 12 on BT_BASE_UUID (default).

Parameters
oother comparison argument
Returns
true if equal, otherwise false.

Definition at line 109 of file uuid.cpp.

Here is the caller graph for this function:

◆ getTypeSize()

TypeSize jau::uuid_t::getTypeSize ( ) const
inlinenoexcept

Definition at line 125 of file uuid.hpp.

Here is the caller graph for this function:

◆ getTypeSizeInt()

jau::nsize_t jau::uuid_t::getTypeSizeInt ( ) const
inlinenoexcept

Definition at line 126 of file uuid.hpp.

Here is the caller graph for this function:

◆ getTypeSizeString() [2/2]

std::string jau::uuid_t::getTypeSizeString ( ) const
inlinenoexcept

Definition at line 127 of file uuid.hpp.

Here is the caller graph for this function:

◆ toUUID128()

uuid128_t uuid_t::toUUID128 ( uuid128_t const &  base_uuid = BT_BASE_UUID,
jau::nsize_t const  uuid32_le_octet_index = 12 
) const
noexcept

Definition at line 119 of file uuid.cpp.

Here is the caller graph for this function:

◆ data()

virtual const uint8_t * jau::uuid_t::data ( ) const
pure virtualnoexcept

returns the pointer to the uuid data of size getTypeSize()

Implemented in jau::uuid16_t, jau::uuid32_t, and jau::uuid128_t.

◆ toString()

virtual std::string jau::uuid_t::toString ( ) const
pure virtualnoexcept

Returns the string representation in BE network order, i.e.

00000000-0000-1000-8000-00805F9B34FB.

Implemented in jau::uuid16_t, jau::uuid32_t, and jau::uuid128_t.

Here is the caller graph for this function:

◆ toUUID128String()

virtual std::string jau::uuid_t::toUUID128String ( uuid128_t const &  base_uuid = BT_BASE_UUID,
jau::nsize_t const  le_octet_index = 12 
) const
pure virtualnoexcept

Returns the uuid128_t string representation in BE network order, i.e.

00000000-0000-1000-8000-00805F9B34FB.

Implemented in jau::uuid16_t, jau::uuid32_t, and jau::uuid128_t.

◆ put()

virtual jau::nsize_t jau::uuid_t::put ( uint8_t *const  buffer,
lb_endian_t const  le_or_be 
) const
pure virtualnoexcept

Implemented in jau::uuid16_t, jau::uuid32_t, and jau::uuid128_t.

Here is the caller graph for this function:

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