Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
HashIndexed< BA, IMP > Struct Template Reference

#include "lib/hash-indexed.hpp"

Description

template<class BA, class IMP>
struct lib::HashIndexed< BA, IMP >

A Mixin to add a private ID type to the target class, together with storage to hold an instance of this ID, getter and setter, and a templated version of the ID type which can be used to pass specific subclass type info.

Definition at line 124 of file hash-indexed.hpp.

Classes

struct  ID
 generic hash based ID, corresponding to the base class BA More...
 
struct  Id
 Hash based ID, typed to a specific subclass of BA. More...
 
struct  UseEmbeddedHash
 enables use of BA objects as keys within std::unordered_map More...
 
struct  UseHashID
 trivial hash functor using the ID as hash More...
 

Public Member Functions

ID const & getID () const
 
template<typename T >
Id< T > const & recastID () const
 redefining of the specific type info of the Id is allowed, as all share the same implementation
 
void assignID (HashIndexed const &ref)
 

Friends

bool operator== (HashIndexed const &hal, HashIndexed const &har)
 equality comparison delegated to the ID implementation
 
bool operator!= (HashIndexed const &hal, HashIndexed const &har)
 

Protected Member Functions

 HashIndexed ()
 
 HashIndexed (IMP const &iref)
 

Private Attributes

ID id_
 

Constructor & Destructor Documentation

◆ HashIndexed() [1/2]

template<class BA , class IMP >
HashIndexed ( )
inlineprotected

Definition at line 188 of file hash-indexed.hpp.

◆ HashIndexed() [2/2]

template<class BA , class IMP >
HashIndexed ( IMP const &  iref)
inlineprotected

Definition at line 189 of file hash-indexed.hpp.

Member Function Documentation

◆ getID()

template<class BA , class IMP >
ID const & getID ( ) const
inline

Definition at line 162 of file hash-indexed.hpp.

References HashIndexed< BA, IMP >::id_.

Referenced by HashIndexed< BA, IMP >::assignID(), HashIndexed_test::checkBasicProperties(), TestB::operator==(), and HashIndexed< BA, IMP >::recastID().

+ Here is the caller graph for this function:

◆ recastID()

template<class BA , class IMP >
template<typename T >
Id< T > const & recastID ( ) const
inline

redefining of the specific type info of the Id is allowed, as all share the same implementation

Definition at line 171 of file hash-indexed.hpp.

References HashIndexed< BA, IMP >::getID().

+ Here is the call graph for this function:

◆ assignID()

template<class BA , class IMP >
void assignID ( HashIndexed< BA, IMP > const &  ref)
inline

Definition at line 177 of file hash-indexed.hpp.

References HashIndexed< BA, IMP >::getID(), and HashIndexed< BA, IMP >::id_.

+ Here is the call graph for this function:

Member Data Documentation

◆ id_

template<class BA , class IMP >
ID id_
private

Friends And Related Symbol Documentation

◆ operator==

template<class BA , class IMP >
bool operator== ( HashIndexed< BA, IMP > const &  hal,
HashIndexed< BA, IMP > const &  har 
)
friend

equality comparison delegated to the ID implementation

Definition at line 183 of file hash-indexed.hpp.

◆ operator!=

template<class BA , class IMP >
bool operator!= ( HashIndexed< BA, IMP > const &  hal,
HashIndexed< BA, IMP > const &  har 
)
friend

Definition at line 184 of file hash-indexed.hpp.

+ Inheritance diagram for HashIndexed< BA, IMP >:
+ Collaboration diagram for HashIndexed< BA, IMP >:

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