Lumiera  0.pre.03
»edit your freedom«
BareEntryID Class Reference

#include "lib/idi/entry-id.hpp"

Description

type erased baseclass for building a combined hash and symbolic ID.

Definition at line 142 of file entry-id.hpp.

Public Member Functions

LuidH const & getHash () const
 
string const & getSym () const
 
bool isValid () const
 
 operator string () const
 
template<typename TAR >
EntryID< TAR > const & recast () const
 try to upcast this BareEntryID to a fully typed EntryID. More...
 

Classes

struct  UseEmbeddedHash
 using BareEntryID derived objects as keys within std::unordered_map More...
 

Protected Member Functions

 BareEntryID (string const &symbolID, HashVal seed)
 Not to be created stand-alone. More...
 
 BareEntryID (string const &symbolID)
 store the symbol but use a random hash part
 

Private Attributes

LuidH hash_
 
string symbol_
 

Constructor & Destructor Documentation

◆ BareEntryID()

BareEntryID ( string const &  symbolID,
HashVal  seed 
)
inlineprotected

Not to be created stand-alone.

derived classes feed down the specific type information encoded into a hash seed. Thus even the same symbolicID generates differing hash-IDs for different type parameters

Definition at line 156 of file entry-id.hpp.

Member Function Documentation

◆ recast()

EntryID< TAR > const & recast ( ) const

try to upcast this BareEntryID to a fully typed EntryID.

Effectively, this is the attempt to reverse a type erasure; thus the caller needs to know the type information (as provided by the template parameter), because this information can't be recovered from the stored data.

Exceptions
error::Logicif the given type parameter isn't exactly the same as was used on creation of the original EntryID, prior to type erasing it into a BareEntryID. Implemented by re-calculating the hash from typeinfo + symbolicID; Exception if it doesn't match the stored hash.

Definition at line 331 of file entry-id.hpp.

Referenced by EntryID_test::checkErasure().

+ Here is the caller graph for this function:
+ Inheritance diagram for BareEntryID:
+ Collaboration diagram for BareEntryID:

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