liblas::guid Class Reference

Definition of Globally Unique Identifier type. More...

#include <guid.hpp>

List of all members.


Public Member Functions

 guid ()
 Default constructor initializes GUID as null.
 guid (char const *const str)
 Initializes from textual representation of valid GUID.
template<typename ch, typename char_traits, typename alloc>
 guid (std::basic_string< ch, char_traits, alloc > const &str)
 Initializes from textual representation of valid GUID.
 guid (liblas::uint32_t const &d1, liblas::uint16_t const &d2, liblas::uint16_t const &d3, liblas::uint8_t const (&d4)[8])
 Initializes from 4-fields structure.
 guid (guid const &rhs)
 Copy constructor.
 ~guid ()
 Destructor.
guidoperator= (guid const &rhs)
 Assignment operator.
bool operator== (guid const &rhs) const
 Equality operator.
bool operator!= (guid const &rhs) const
 Inequality operator.
bool operator< (guid const &rhs) const
 Less-than operator.
bool operator> (guid const &rhs) const
 More-than operator.
bool operator<= (guid const &rhs) const
 Less-than-or-equal-to operator.
bool operator>= (guid const &rhs) const
 More-than-or-equal-to operator.
bool is_null () const
 Test if the GUID object is null GUID or not.
std::string to_string () const
 Generate textual representation of the GUID number.
template<typename ch, typename char_traits, typename alloc>
std::basic_string< ch,
char_traits, alloc > 
to_basic_string () const
 Generic generator of textual representation of the GUID number.
size_t byte_count () const
 Size of the GUID number in bytes.
template<typename ByteOutputIterator>
void output_bytes (ByteOutputIterator out) const
 Send bytes of GUID data to sequenec of bytes using given output iterator.
void output_data (liblas::uint32_t &d1, liblas::uint16_t &d2, liblas::uint16_t &d3, liblas::uint8_t(&d4)[8]) const
 Separate bytes of GUID data to distinct buffers.

Static Public Member Functions

static guid const & null ()
 Null GUID number generator.
static guid create ()
 Random GUID number generator.
static guid create (guid const &namespace_guid, char const *name, int name_length)
 Create GUID number based on calculation of SHA1 has for given name.
static bool get_showbraces (std::ios_base &iosbase)
 Return flag indicating if bracket text form of GUID on output is set.
static void set_showbraces (std::ios_base &iosbase, bool showbraces)
 Request to bracket text form of GUID on output.
static std::ios_base & showbraces (std::ios_base &iosbase)
 Request to bracket text form of GUID on output.
static std::ios_base & noshowbraces (std::ios_base &iosbase)

Friends

std::ostream & operator<< (std::ostream &os, guid const &g)
 Overloaded output stream operator for guid type.
std::istream & operator>> (std::istream &is, guid &g)
 Overloaded input stream operator for guid type.

Detailed Description

Definition of Globally Unique Identifier type.

The GUID is a 16-byte (128-bit) number. This class is used to represent value stored as Project Identifier in public header block (see LASHeader) of a LAS file. All files in a unique project should have the same value of the Project Identifier. It is used together with File Source ID to uniquely identify every LAS, globally.

See also:
About GUID in Wikipedia http://en.wikipedia.org/wiki/Globally_Unique_Identifier

Definition at line 88 of file guid.hpp.


Constructor & Destructor Documentation

liblas::guid::guid (  )  [inline]

Default constructor initializes GUID as null.

Exceptions:
nothrow 
Postcondition:
guid::is_null() == true.

Definition at line 95 of file guid.hpp.

liblas::guid::guid ( char const *const   str  )  [inline, explicit]

Initializes from textual representation of valid GUID.

Parameters:
str - non-null pointer to string with GUID text.
Exceptions:
std::invalid_argument if construction failed.
Postcondition:
guid::is_null() == false.

Definition at line 104 of file guid.hpp.

template<typename ch, typename char_traits, typename alloc>
liblas::guid::guid ( std::basic_string< ch, char_traits, alloc > const &  str  )  [inline, explicit]

Initializes from textual representation of valid GUID.

Parameters:
str - string with GUID text.
Exceptions:
std::invalid_argument if construction failed.
Postcondition:
guid::is_null() == false.

Definition at line 116 of file guid.hpp.

liblas::guid::guid ( liblas::uint32_t const &  d1,
liblas::uint16_t const &  d2,
liblas::uint16_t const &  d3,
liblas::uint8_t const &  d4[8] 
) [inline]

Initializes from 4-fields structure.

Parameters:
d1 - field of first 32 bits of GUID number.
d2 - field of subsequent 16 bits of GUID number.
d3 - third field of 16 bits of GUID number.
d4 - last 64 bits of GUID number.
Exceptions:
std::invalid_argument if construction failed.
Postcondition:
guid::is_null() == false.

Definition at line 128 of file guid.hpp.

liblas::guid::guid ( guid const &  rhs  )  [inline]

Copy constructor.

Exceptions:
nothrow 

Definition at line 135 of file guid.hpp.

References data_.

liblas::guid::~guid (  )  [inline]

Destructor.

Exceptions:
nothrow 

Definition at line 142 of file guid.hpp.


Member Function Documentation

guid& liblas::guid::operator= ( guid const &  rhs  )  [inline]

Assignment operator.

Exceptions:
nothrow 

Definition at line 147 of file guid.hpp.

References data_.

bool liblas::guid::operator== ( guid const &  rhs  )  const [inline]

Equality operator.

Exceptions:
nothrow 

Definition at line 158 of file guid.hpp.

bool liblas::guid::operator!= ( guid const &  rhs  )  const [inline]

Inequality operator.

Exceptions:
nothrow 

Definition at line 165 of file guid.hpp.

bool liblas::guid::operator< ( guid const &  rhs  )  const [inline]

Less-than operator.

Parameters:
rhs - GUID object on the right-hand side of the comparison.
Returns:
true if the GUID on the left-hand side is lexicographically less than GUID on the right side; false otherwise.
Exceptions:
nothrow 

Definition at line 175 of file guid.hpp.

bool liblas::guid::operator> ( guid const &  rhs  )  const [inline]

More-than operator.

Parameters:
rhs - GUID object on the right-hand side of the comparison.
Returns:
true if the GUID on the left-hand side is not lexicographically less than GUID on the right side; false otherwise.
Exceptions:
nothrow 

Definition at line 185 of file guid.hpp.

bool liblas::guid::operator<= ( guid const &  rhs  )  const [inline]

Less-than-or-equal-to operator.

Parameters:
rhs - GUID object on the right-hand side of the comparison.
Exceptions:
nothrow 

Definition at line 193 of file guid.hpp.

bool liblas::guid::operator>= ( guid const &  rhs  )  const [inline]

More-than-or-equal-to operator.

Parameters:
rhs - GUID object on the right-hand side of the comparison.
Exceptions:
nothrow 

Definition at line 201 of file guid.hpp.

bool liblas::guid::is_null (  )  const [inline]

Test if the GUID object is null GUID or not.

Null means GUID number value is Zero.

Returns:
true if the GUID is null; false otherwise
Exceptions:
nothrow 

Definition at line 210 of file guid.hpp.

References null().

Here is the call graph for this function:

std::string liblas::guid::to_string (  )  const [inline]

Generate textual representation of the GUID number.

Specialization for std::string type.

Returns:
string with textual representation of GUID
Exceptions:
std::runtime_error - thrown on GUID to string conversion failure
Postcondition:
guid::to_string().empty() == false.

Definition at line 220 of file guid.hpp.

template<typename ch, typename char_traits, typename alloc>
std::basic_string<ch, char_traits, alloc> liblas::guid::to_basic_string (  )  const [inline]

Generic generator of textual representation of the GUID number.

Exceptions:
std::runtime_error - thrown on GUID to string conversion failure
Postcondition:
guid::to_basic_string().empty() == false.

Definition at line 229 of file guid.hpp.

size_t liblas::guid::byte_count (  )  const [inline]

Size of the GUID number in bytes.

Returns:
The number of bytes is constant for all GUID objects and equal to 16 bytes (128-bit number).

Definition at line 247 of file guid.hpp.

template<typename ByteOutputIterator>
void liblas::guid::output_bytes ( ByteOutputIterator  out  )  const [inline]

Send bytes of GUID data to sequenec of bytes using given output iterator.

Exceptions:
nothrow 

Definition at line 256 of file guid.hpp.

void liblas::guid::output_data ( liblas::uint32_t &  d1,
liblas::uint16_t &  d2,
liblas::uint16_t &  d3,
liblas::uint8_t &  d4[8] 
) const [inline]

Separate bytes of GUID data to distinct buffers.

Parameters:
d1 - buffer for first 32 bits of GUID number.
d2 - buffer for 16 bits of second chunk of GUID number.
d3 - buffer for 16 bits of third chunk of GUID number.
d4 - buffer for last 64 bits of GUID number.
Exceptions:
nothrow 

Definition at line 267 of file guid.hpp.

static guid const& liblas::guid::null (  )  [inline, static]

Null GUID number generator.

Returns:
null-initialized instance of GUID number.
Exceptions:
nothrow 

Definition at line 301 of file guid.hpp.

Referenced by is_null().

Here is the caller graph for this function:

static guid liblas::guid::create (  )  [inline, static]

Random GUID number generator.

Returns:
random-initialized instance of GUID number.
Exceptions:
nothrow 

Definition at line 310 of file guid.hpp.

static guid liblas::guid::create ( guid const &  namespace_guid,
char const *  name,
int  name_length 
) [inline, static]

Create GUID number based on calculation of SHA1 has for given name.

Exceptions:
std::runtime_error on GUID creation failure.

Definition at line 317 of file guid.hpp.

static bool liblas::guid::get_showbraces ( std::ios_base &  iosbase  )  [inline, static]

Return flag indicating if bracket text form of GUID on output is set.

Exceptions:
nothrow 

Definition at line 324 of file guid.hpp.

Referenced by liblas::operator<<().

Here is the caller graph for this function:

static void liblas::guid::set_showbraces ( std::ios_base &  iosbase,
bool  showbraces 
) [inline, static]

Request to bracket text form of GUID on output.

Exceptions:
nothrow 

Definition at line 331 of file guid.hpp.

Referenced by noshowbraces(), and showbraces().

Here is the caller graph for this function:

static std::ios_base& liblas::guid::showbraces ( std::ios_base &  iosbase  )  [inline, static]

Request to bracket text form of GUID on output.

Exceptions:
nothrow 

Definition at line 338 of file guid.hpp.

References set_showbraces().

Here is the call graph for this function:

static std::ios_base& liblas::guid::noshowbraces ( std::ios_base &  iosbase  )  [inline, static]

Definition at line 343 of file guid.hpp.

References set_showbraces().

Here is the call graph for this function:


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
guid const &  g 
) [friend]

Overloaded output stream operator for guid type.

Definition at line 480 of file guid.hpp.

std::istream& operator>> ( std::istream &  is,
guid g 
) [friend]

Overloaded input stream operator for guid type.

Definition at line 522 of file guid.hpp.


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