Lumiera  0.pre.03
»edityourfreedom«
BareEntryID Class Reference

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

Description

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

Definition at line 135 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=0)
 Not to be created stand-alone. More...
 

Private Attributes

LuidH hash_
 
string symbol_
 

Constructor & Destructor Documentation

◆ BareEntryID()

BareEntryID ( string const &  symbolID,
HashVal  seed = 0 
)
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 149 of file entry-id.hpp.

Member Function Documentation

◆ isValid()

bool isValid ( ) const
inline

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

Referenced by EntryID_test::checkCreation(), and Fork::isValid().

+ Here is the caller graph for this function:

◆ getSym()

◆ getHash()

LuidH const& getHash ( ) const
inline

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

Referenced by EntryID< StreamType >::canRecast(), EntryID_test::checkBasicProperties(), EntryID_test::checkErasure(), BareEntryID::UseEmbeddedHash::operator()(), lib::idi::operator==(), and GenNodeBasic_test::symbolReference().

+ Here is the caller graph for this function:

◆ operator string()

operator string ( ) const
inline

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

References lib::idi::format::instance_hex_format().

+ Here is the call graph for this function:

◆ 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 297 of file entry-id.hpp.

Referenced by EntryID_test::checkErasure().

+ Here is the caller graph for this function:

Member Data Documentation

◆ symbol_

string symbol_
private

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

◆ hash_

LuidH hash_
private

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

+ Inheritance diagram for BareEntryID:
+ Collaboration diagram for BareEntryID:

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