MADNESS  0.10.1
Public Member Functions | Private Attributes | Friends | List of all members

Class for unique global IDs. More...

#include <uniqueid.h>

Public Member Functions

 uniqueidT ()
 Default constructor. More...
 
 uniqueidT (unsigned long worldid, unsigned long objid)
 Constructor that uses the world and object IDs. More...
 
unsigned long get_obj_id () const
 Access the object ID. More...
 
unsigned long get_world_id () const
 Access the World ID. More...
 
 operator bool () const
 nonnull state tester More...
 
template<typename Archive >
void serialize (Archive &ar)
 Serialize a unique ID object. More...
 

Private Attributes

unsigned long objid
 ID of the object. More...
 
unsigned long worldid
 ID of the World the object belongs to. More...
 

Friends

template<typename CharT , typename Traits >
std::basic_ostream< CharT, Traits > & operator<< (std::basic_ostream< CharT, Traits > &s, const uniqueidT &id)
 Stream insertion function for a uniqueidT. More...
 
class World
 

Detailed Description

Class for unique global IDs.

Constructor & Destructor Documentation

◆ uniqueidT() [1/2]

madness::uniqueidT::uniqueidT ( )
inline

Default constructor.

◆ uniqueidT() [2/2]

madness::uniqueidT::uniqueidT ( unsigned long  worldid,
unsigned long  objid 
)
inline

Constructor that uses the world and object IDs.

Parameters
[in]worldidThe ID of the World the object belongs to.
[in]objidThe ID of the object.

Member Function Documentation

◆ get_obj_id()

unsigned long madness::uniqueidT::get_obj_id ( ) const
inline

Access the object ID.

Returns
The object ID.

References objid.

◆ get_world_id()

unsigned long madness::uniqueidT::get_world_id ( ) const
inline

Access the World ID.

Returns
The World ID.

References worldid.

◆ operator bool()

madness::uniqueidT::operator bool ( ) const
inlineexplicit

nonnull state tester

Returns
return true if non-default initialized

References objid.

◆ serialize()

template<typename Archive >
void madness::uniqueidT::serialize ( Archive &  ar)
inline

Serialize a unique ID object.

Template Parameters
ArchiveThe archive type.
Parameters
[in,out]arThe archive.

References objid, and worldid.

Friends And Related Function Documentation

◆ operator<<

template<typename CharT , typename Traits >
std::basic_ostream<CharT, Traits>& operator<< ( std::basic_ostream< CharT, Traits > &  s,
const uniqueidT id 
)
friend

Stream insertion function for a uniqueidT.

Template Parameters
CharTa character type
Traitsa traits type describing CharT
Parameters
[in,out]sThe output stream.
[in]idThe uniqueidT to be output.
Returns
The output stream (for chaining).

◆ World

friend class World
friend

Member Data Documentation

◆ objid

unsigned long madness::uniqueidT::objid
private

ID of the object.

Referenced by get_obj_id(), operator bool(), and serialize().

◆ worldid

unsigned long madness::uniqueidT::worldid
private

ID of the World the object belongs to.

Referenced by get_world_id(), and serialize().


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