DUDS
Distributed Update of Data from Something
duds::Something Class Referenceabstract

Something specific; a base class for identifying things. More...

#include <Something.hpp>

Inheritance diagram for duds::Something:
Collaboration diagram for duds::Something:

Public Member Functions

virtual ~Something ()=0
 
std::string getName () const
 Returns the name for the current locale. More...
 
const general::LanguageTaggedStringMapnames () const
 Returns the set of names for all locales and languages. More...
 
bool operator!= (const Something &s) const
 Something objects are compared using the someId member. More...
 
bool operator< (const Something &s) const
 Something objects are compared using the someId member. More...
 
bool operator<= (const Something &s) const
 Something objects are compared using the someId member. More...
 
bool operator== (const Something &s) const
 Something objects are compared using the someId member. More...
 
bool operator> (const Something &s) const
 Something objects are compared using the someId member. More...
 
bool operator>= (const Something &s) const
 Something objects are compared using the someId member. More...
 
template<class DerivedClass >
std::shared_ptr< DerivedClass > sharedPtr () const
 Returns a shared pointer to this object for a derived class. More...
 
const boost::uuids::uuid & uuid () const
 Returns the object's unique identifier. More...
 

Protected Member Functions

 Something ()=default
 Simple constructor. More...
 
 Something (const boost::uuids::uuid &id)
 Creates Something with the given UUID. More...
 
void setUuid (const boost::uuids::uuid &id)
 Sets the UUID that is associated with this object. More...
 

Protected Attributes

general::LanguageTaggedStringMap ltnames
 A name for this item intended for user presentation. More...
 

Private Attributes

boost::uuids::uuid someId
 A unique identifier that is valid across all peers. More...
 

Detailed Description

Something specific; a base class for identifying things.

Note
All instances of Something must have their memory handled by a std::shared_prt<Something> object.
Author
Jeff Jackowski

Definition at line 26 of file Something.hpp.

Constructor & Destructor Documentation

◆ Something() [1/2]

duds::Something::Something ( )
protecteddefault

Simple constructor.

Postcondition
The object's UUID, someId, is uninitialized.

◆ Something() [2/2]

duds::Something::Something ( const boost::uuids::uuid &  id)
inlineprotected

Creates Something with the given UUID.

Parameters
idThe initial UUID to identify this object.

Definition at line 47 of file Something.hpp.

◆ ~Something()

duds::Something::~Something ( )
pure virtual

Definition at line 5 of file Something.cpp.

Referenced by setUuid().

Member Function Documentation

◆ getName()

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

Returns the name for the current locale.

Todo:
Implement properly.

Referenced by names().

◆ names()

const general::LanguageTaggedStringMap& duds::Something::names ( ) const
inline

Returns the set of names for all locales and languages.

Definition at line 78 of file Something.hpp.

◆ operator!=()

bool duds::Something::operator!= ( const Something s) const
inline

Something objects are compared using the someId member.

Definition at line 119 of file Something.hpp.

◆ operator<()

bool duds::Something::operator< ( const Something s) const
inline

Something objects are compared using the someId member.

Definition at line 89 of file Something.hpp.

◆ operator<=()

bool duds::Something::operator<= ( const Something s) const
inline

Something objects are compared using the someId member.

Definition at line 101 of file Something.hpp.

◆ operator==()

bool duds::Something::operator== ( const Something s) const
inline

Something objects are compared using the someId member.

Definition at line 113 of file Something.hpp.

◆ operator>()

bool duds::Something::operator> ( const Something s) const
inline

Something objects are compared using the someId member.

Definition at line 95 of file Something.hpp.

◆ operator>=()

bool duds::Something::operator>= ( const Something s) const
inline

Something objects are compared using the someId member.

Definition at line 107 of file Something.hpp.

◆ setUuid()

void duds::Something::setUuid ( const boost::uuids::uuid &  id)
inlineprotected

Sets the UUID that is associated with this object.

Precondition
The object is still being prepared for use. The UUID must not be changed once the object is in use.
Parameters
idThe new UUID.

Definition at line 54 of file Something.hpp.

◆ sharedPtr()

template<class DerivedClass >
std::shared_ptr<DerivedClass> duds::Something::sharedPtr ( ) const
inline

Returns a shared pointer to this object for a derived class.

Template Parameters
DerivedClassThe class derived from this class.
Returns
A shared pointer containing this object with the type of the derived class.

Definition at line 66 of file Something.hpp.

◆ uuid()

const boost::uuids::uuid& duds::Something::uuid ( ) const
inline

Returns the object's unique identifier.

Definition at line 72 of file Something.hpp.

Member Data Documentation

◆ ltnames

general::LanguageTaggedStringMap duds::Something::ltnames
protected

A name for this item intended for user presentation.

Definition at line 37 of file Something.hpp.

Referenced by names().

◆ someId

boost::uuids::uuid duds::Something::someId
private

A unique identifier that is valid across all peers.

Definition at line 32 of file Something.hpp.

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


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