C++ SDK Documentation  12.0.0
Vertica::VUuid Class Reference

Representation of Universally Unique Identifier (UUID) data type in Vertica. More...

Collaboration diagram for Vertica::VUuid:
Collaboration graph

Public Member Functions

 VUuid (vuuid_t *data)
 Create a Universally Unique Identifier type from a vuuid_t array. More...
 
 VUuid (const VUuid &other)
 
int compare (const VUuid &from) const
 Compares this VUuid to another. More...
 
void copy (const VUuid &from)
 Copy data from another VUuid. More...
 
bool equal (const VUuid &from) const
 Indicates whether another VUuid is equal to this one. More...
 
bool fromCharArray (const char *str)
 Populate this UUID's data array from a string representation. More...
 
bool fromString (const std::string &str)
 Populate this UUID's data array from a string representation. More...
 
vuuid_t & getData ()
 Get a reference to the data array.
 
const vuuid_t & getData () const
 Get a const reference to the data array.
 
bool isNull () const
 Indicates if this VUuid is the SQL NULL value. More...
 
bool operator< (const VUuid &other) const
 
bool operator<= (const VUuid &other) const
 
VUuidoperator= (const VUuid &other)
 
bool operator== (const VUuid &other) const
 
bool operator> (const VUuid &other) const
 
bool operator>= (const VUuid &other) const
 
void setNull ()
 Sets this VUuid to the SQL NULL value. More...
 
void toCharArray (char *buf, size_t bufLen) const
 Return a string representation of this UUID. More...
 
std::string toString () const
 Return a string representation of this UUID. More...
 

Detailed Description

Representation of Universally Unique Identifier (UUID) data type in Vertica.

Constructor & Destructor Documentation

Vertica::VUuid::VUuid ( vuuid_t *  data)
inline

Create a Universally Unique Identifier type from a vuuid_t array.

Note
It is the callers responsibility to allocate and manage the lifetime of the data array, which is UUID_LEN bytes long.

Example:

vuuid_t data = {
0x06, 0xbe, 0x07, 0x79, 0xc0, 0xb7, 0x46, 0xcb,
0x8a, 0x16, 0x99, 0x09, 0x26, 0x99, 0x9a, 0xfd,
};
VUuid uuid(data);

Member Function Documentation

int Vertica::VUuid::compare ( const VUuid from) const
inline

Compares this VUuid to another.

Parameters
fromThe VUuid to compare to
Returns
-1 if this < other, 0 if equal, 1 if this > other
Note
SQL NULL compares less than anything else; two SQL NULLs are considered equal

Referenced by equal().

void Vertica::VUuid::copy ( const VUuid from)
inline

Copy data from another VUuid.

Parameters
fromThe source VUuid
bool Vertica::VUuid::equal ( const VUuid from) const
inline

Indicates whether another VUuid is equal to this one.

Parameters
otherThe VUuid to compare to
bool Vertica::VUuid::fromCharArray ( const char *  str)
inline

Populate this UUID's data array from a string representation.

Note
str should be valid UUID format
Returns
true on success
bool Vertica::VUuid::fromString ( const std::string &  str)
inline

Populate this UUID's data array from a string representation.

Returns
true on success
bool Vertica::VUuid::isNull ( ) const
inline

Indicates if this VUuid is the SQL NULL value.

Note
NULL is the UUID NIL value 00000000-0000-0000-0000-000000000000

Referenced by Vertica::BlockReader::isNull().

void Vertica::VUuid::setNull ( )
inline

Sets this VUuid to the SQL NULL value.

Note
NULL is the UUID NIL value 00000000-0000-0000-0000-000000000000

Referenced by Vertica::BlockWriter::setNull(), and Vertica::ValueRangeWriter::setNull().

void Vertica::VUuid::toCharArray ( char *  buf,
size_t  bufLen 
) const
inline

Return a string representation of this UUID.

Parameters
Bufferfor result, must be at least UUID_PRINT_LEN bytes
Note
Format is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
std::string Vertica::VUuid::toString ( ) const
inline

Return a string representation of this UUID.

Note
Format is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx