feisty meow concerns codebase  2.140
structures::unique_id< uniquifier > Class Template Reference

Provides an abstraction for the responsibilities of a unique identifier. More...

#include <unique_id.h>

Inheritance diagram for structures::unique_id< uniquifier >:
Collaboration diagram for structures::unique_id< uniquifier >:

Public Member Functions

 unique_id (uniquifier initial_value)
 Constructs a unique id from the "initial_value". More...
 
 unique_id (const unique_id< uniquifier > &to_copy)
 Constructs a unique id as a copy of the "to_copy" object. More...
 
 ~unique_id ()
 
virtual bool equal_to (const equalizable &to_compare) const
 
bool operator== (const unique_id< uniquifier > &to_compare) const
 Returns true if the held id is the same as "to_compare". More...
 
unique_idoperator= (const unique_id< uniquifier > &to_copy)
 Sets this id to be the same as "to_copy". More...
 
uniquifier raw_id () const
 Returns the held identifier in its native form. More...
 
void set_raw_id (uniquifier new_value)
 Sets the held identifier to "new_value". More...
 
- Public Member Functions inherited from basis::equalizable
virtual bool equal_to (const equalizable &s2) const =0
 
virtual bool operator== (const equalizable &s2) const
 the virtual method for object equality. More...
 

Detailed Description

template<class uniquifier>
class structures::unique_id< uniquifier >

Provides an abstraction for the responsibilities of a unique identifier.

These are generally used as a way of masking the underlying ID object while providing some equality comparisons. It is especially useful when the underlying object is not itself an object, but just a simple type.

Definition at line 30 of file unique_id.h.

Constructor & Destructor Documentation

◆ unique_id() [1/2]

template<class uniquifier >
structures::unique_id< uniquifier >::unique_id ( uniquifier  initial_value)
inline

Constructs a unique id from the "initial_value".

Definition at line 33 of file unique_id.h.

◆ unique_id() [2/2]

template<class uniquifier >
structures::unique_id< uniquifier >::unique_id ( const unique_id< uniquifier > &  to_copy)
inline

Constructs a unique id as a copy of the "to_copy" object.

Definition at line 36 of file unique_id.h.

◆ ~unique_id()

template<class uniquifier >
structures::unique_id< uniquifier >::~unique_id ( )
inline

Definition at line 39 of file unique_id.h.

Member Function Documentation

◆ equal_to()

template<class uniquifier >
virtual bool structures::unique_id< uniquifier >::equal_to ( const equalizable &  to_compare) const
inlinevirtual

Definition at line 41 of file unique_id.h.

◆ operator=()

template<class uniquifier >
unique_id& structures::unique_id< uniquifier >::operator= ( const unique_id< uniquifier > &  to_copy)
inline

Sets this id to be the same as "to_copy".

Definition at line 54 of file unique_id.h.

◆ operator==()

template<class uniquifier >
bool structures::unique_id< uniquifier >::operator== ( const unique_id< uniquifier > &  to_compare) const
inline

Returns true if the held id is the same as "to_compare".

The templated uniquifying type absolutely must provide an equality operator (==) and an assignment operator (=).

Definition at line 50 of file unique_id.h.

◆ raw_id()

template<class uniquifier >
uniquifier structures::unique_id< uniquifier >::raw_id ( ) const
inline

Returns the held identifier in its native form.

Definition at line 57 of file unique_id.h.

Referenced by processes::post_office::deliver_mail_on_route(), and structures::orderable_unique_id< uniquifier >::operator<().

◆ set_raw_id()

template<class uniquifier >
void structures::unique_id< uniquifier >::set_raw_id ( uniquifier  new_value)
inline

Sets the held identifier to "new_value".

Definition at line 60 of file unique_id.h.


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