Visualization Library v1.0.3

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | Public Attributes

vl::UUID Class Reference

Simple implementation of a 16 bytes Universally Unique ID based on http://www.ietf.org/rfc/rfc4122.txt. More...

#include <UUID.hpp>

List of all members.

Public Member Functions

 UUID ()
 Constructor, by default it is set to all zeros.
void generateVersion4 (const Random &random)
 Generates a Version 4 UUID as defined by RFC4122 using the specified random number generator.
bool fromString (const char *guid_str)
 Init the UUID from the specified string which must be at least 38 characters long and must be of the form {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}.
void fillString (char *guid_str, bool zero_terminate=true) const
 Fills a buffer with an ascii representation of the UUID of type {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}.
void toStdString (std::string &guid_str) const
 Fills the given std::string with an ASCII representation of the UUID of type {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}.
std::string toStdString () const
 Returns an std::string jwith an ASCII representation of the UUID of type {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}.
bool operator== (const UUID &other) const
bool operator!= (const UUID &other) const
bool operator< (const UUID &other) const

Public Attributes

unsigned int mTimeLow
unsigned short mTimeMid
unsigned short mTimeHiAndVersion
unsigned char mClockSeqHiAndReserved
unsigned char mClockSeqLow
unsigned char mNode [6]

Detailed Description

Simple implementation of a 16 bytes Universally Unique ID based on http://www.ietf.org/rfc/rfc4122.txt.

Definition at line 44 of file UUID.hpp.


Constructor & Destructor Documentation

UUID::UUID (  )

Constructor, by default it is set to all zeros.

Definition at line 40 of file UUID.cpp.


Member Function Documentation

void UUID::generateVersion4 ( const Random random )

Generates a Version 4 UUID as defined by RFC4122 using the specified random number generator.

Definition at line 45 of file UUID.cpp.

References vl::Random::fillRandom(), mClockSeqHiAndReserved, and mTimeHiAndVersion.

bool UUID::fromString ( const char *  guid_str )

Init the UUID from the specified string which must be at least 38 characters long and must be of the form {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}.

Definition at line 137 of file UUID.cpp.

References mClockSeqHiAndReserved, mClockSeqLow, mNode, mTimeHiAndVersion, mTimeLow, and mTimeMid.

void UUID::fillString ( char *  guid_str,
bool  zero_terminate = true 
) const

Fills a buffer with an ascii representation of the UUID of type {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}.

Parameters:
guid_strmust point to a buffer of at least 38 byes; if zero_terminate is true (default) then it must be at least 39 bytes large.
zero_terminateif true the function inserts a trailing 0 at the end of the string, in this case guid_str must point to a buffer 39 bytes large at least.

Definition at line 68 of file UUID.cpp.

References mClockSeqHiAndReserved, mClockSeqLow, mNode, mTimeHiAndVersion, mTimeLow, mTimeMid, and VL_CHECK.

Referenced by toStdString().

void UUID::toStdString ( std::string &  guid_str ) const

Fills the given std::string with an ASCII representation of the UUID of type {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}.

Definition at line 58 of file UUID.cpp.

References fillString().

std::string UUID::toStdString (  ) const

Returns an std::string jwith an ASCII representation of the UUID of type {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}.

Definition at line 130 of file UUID.cpp.

bool vl::UUID::operator== ( const UUID other ) const [inline]

Definition at line 67 of file UUID.hpp.

bool vl::UUID::operator!= ( const UUID other ) const [inline]

Definition at line 72 of file UUID.hpp.

bool vl::UUID::operator< ( const UUID other ) const [inline]

Definition at line 77 of file UUID.hpp.


Member Data Documentation

unsigned int vl::UUID::mTimeLow

Definition at line 83 of file UUID.hpp.

Referenced by fillString(), and fromString().

unsigned short vl::UUID::mTimeMid

Definition at line 84 of file UUID.hpp.

Referenced by fillString(), and fromString().

Definition at line 85 of file UUID.hpp.

Referenced by fillString(), fromString(), and generateVersion4().

Definition at line 86 of file UUID.hpp.

Referenced by fillString(), fromString(), and generateVersion4().

unsigned char vl::UUID::mClockSeqLow

Definition at line 87 of file UUID.hpp.

Referenced by fillString(), and fromString().

unsigned char vl::UUID::mNode[6]

Definition at line 88 of file UUID.hpp.

Referenced by fillString(), and fromString().


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

Visualization Library v1.0.3 Reference Documentation
Copyright Michele Bosi. All rights reserved.
Updated on Tue Feb 7 2017 00:55:08.
Permission is granted to use this page to write and publish articles regarding Visualization Library.