DUDS
Distributed Update of Data from Something
duds::Identity Class Reference

The identification for something that is unique across all peers. More...

#include <Identity.hpp>

Public Member Functions

 Identity ()
 
 Identity (bool genUuid)
 
 Identity (const boost::uuids::uuid &u)
 
 Identity (const LanguageTaggedStringSet &n, bool genUuid=false)
 
 Identity (const boost::uuids::uuid &u, const LanguageTaggedStringSet &n)
 
std::string getName () const
 Returns the name for the current locale. More...
 
const LanguageTaggedStringSet & getNames () const
 Returns the set of names for all locales and languages. More...
 
const boost::uuids::uuid & getUuid () const
 Returns the object's unique identifier. More...
 
bool operator!= (const Identity &i) const
 Identity objects are compared using the uuid member. More...
 
bool operator< (const Identity &i) const
 Identity objects are compared using the uuid member. More...
 
bool operator<= (const Identity &i) const
 Identity objects are compared using the uuid member. More...
 
bool operator== (const Identity &i) const
 Identity objects are compared using the uuid member. More...
 
bool operator> (const Identity &i) const
 Identity objects are compared using the uuid member. More...
 
bool operator>= (const Identity &i) const
 Identity objects are compared using the uuid member. More...
 

Protected Member Functions

LanguageTaggedStringSet & getNames ()
 
void setNames (const LanguageTaggedStringSet &n)
 
void setUuid (const boost::uuids::uuid &u)
 

Private Attributes

LanguageTaggedStringSet name
 A name for this item intended for user presentation. More...
 
boost::uuids::uuid uuid
 A unique identifier that is valid across all peers. More...
 

Detailed Description

The identification for something that is unique across all peers.

Author
Jeff Jackowski

Definition at line 19 of file Identity.hpp.

Constructor & Destructor Documentation

◆ Identity() [1/5]

duds::Identity::Identity ( )
Note
This sets uuid to all zeros, an invalid id. This is useful to avoid generating UUID when a specific one will be set later.

Referenced by getNames().

◆ Identity() [2/5]

duds::Identity::Identity ( bool  genUuid)

◆ Identity() [3/5]

duds::Identity::Identity ( const boost::uuids::uuid &  u)

◆ Identity() [4/5]

duds::Identity::Identity ( const LanguageTaggedStringSet &  n,
bool  genUuid = false 
)

◆ Identity() [5/5]

duds::Identity::Identity ( const boost::uuids::uuid &  u,
const LanguageTaggedStringSet &  n 
)

Member Function Documentation

◆ getName()

std::string duds::Identity::getName ( ) const

Returns the name for the current locale.

Referenced by getNames().

◆ getNames() [1/2]

LanguageTaggedStringSet& duds::Identity::getNames ( )
inlineprotected

Definition at line 30 of file Identity.hpp.

◆ getNames() [2/2]

const LanguageTaggedStringSet& duds::Identity::getNames ( ) const
inline

Returns the set of names for all locales and languages.

Definition at line 53 of file Identity.hpp.

◆ getUuid()

const boost::uuids::uuid& duds::Identity::getUuid ( ) const
inline

Returns the object's unique identifier.

Definition at line 47 of file Identity.hpp.

◆ operator!=()

bool duds::Identity::operator!= ( const Identity i) const
inline

Identity objects are compared using the uuid member.

Definition at line 93 of file Identity.hpp.

◆ operator<()

bool duds::Identity::operator< ( const Identity i) const
inline

Identity objects are compared using the uuid member.

Definition at line 63 of file Identity.hpp.

◆ operator<=()

bool duds::Identity::operator<= ( const Identity i) const
inline

Identity objects are compared using the uuid member.

Definition at line 75 of file Identity.hpp.

◆ operator==()

bool duds::Identity::operator== ( const Identity i) const
inline

Identity objects are compared using the uuid member.

Definition at line 87 of file Identity.hpp.

◆ operator>()

bool duds::Identity::operator> ( const Identity i) const
inline

Identity objects are compared using the uuid member.

Definition at line 69 of file Identity.hpp.

◆ operator>=()

bool duds::Identity::operator>= ( const Identity i) const
inline

Identity objects are compared using the uuid member.

Definition at line 81 of file Identity.hpp.

◆ setNames()

void duds::Identity::setNames ( const LanguageTaggedStringSet &  n)
protected

Referenced by getNames().

◆ setUuid()

void duds::Identity::setUuid ( const boost::uuids::uuid &  u)
protected

Member Data Documentation

◆ name

LanguageTaggedStringSet duds::Identity::name
private

A name for this item intended for user presentation.

Definition at line 27 of file Identity.hpp.

Referenced by getNames().

◆ uuid

boost::uuids::uuid duds::Identity::uuid
private

A unique identifier that is valid across all peers.

Definition at line 23 of file Identity.hpp.

Referenced by getUuid(), operator!=(), operator<(), operator<=(), operator==(), operator>(), and operator>=().


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