Lumiera  0.pre.03
»edit your freedom«
lib::idi Namespace Reference

Description

Identification Schemes.

Collection of commonly used mechanisms to build identification records, unique identifiers, registration numbers and hashes. These are used as glue and thin abstraction to link various subsystems or to allow interoperation of registration facilities

Namespaces

Classes

class  BareEntryID
 type erased baseclass for building a combined hash and symbolic ID. More...
 
struct  EntryID
 typed symbolic and hash ID for asset-like position accounting. More...
 
struct  RandID
 Entry-ID with a symbolic tag but just a plain random hash part. More...
 

Functions

template<typename TY >
string categoryFolder ()
 
template<class TY >
string generateExtendedID (string prefix="")
 build a long type based identifier, with running counter and custom prefix. More...
 
template<class TY >
string generateSymbolicID ()
 build a per-type identifier, with type prefix and running counter. More...
 
template<typename TY >
HashVal getTypeHash ()
 
template<typename TY >
string instanceTypeID (const TY *const obj)
 designation of an distinct object instance More...
 
template<typename TY >
string namePrefix ()
 
bool operator== (BareEntryID const &i1, BareEntryID const &i2)
 
TypedCountersharedInstanceCounter ()
 
template<typename TY >
string typeFullID ()
 Complete unique type identifier. More...
 
template<typename TY >
string typeSymbol ()
 Short readable type identifier, not necessarily unique or complete. More...
 

Function Documentation

◆ typeSymbol()

string lib::idi::typeSymbol ( )
inline

Short readable type identifier, not necessarily unique or complete.

Returns
the innermost component of the demangled C++ type name. Usually, this is the bare name without any namespaces.
Note
this function is also defined in lib/meta/util.hpp, both delegating to the same implementation

Definition at line 78 of file genfunc.hpp.

References stage::widget::name().

+ Here is the call graph for this function:

◆ typeFullID()

string lib::idi::typeFullID ( )
inline

Complete unique type identifier.

Returns
complete demangled C++ type name, additionally passed through our ID sanitiser function, i.e. one word, no whitespace, only minimal punctuation

Definition at line 90 of file genfunc.hpp.

References stage::widget::name().

+ Here is the call graph for this function:

◆ instanceTypeID()

string lib::idi::instanceTypeID ( const TY *const  obj)
inline

designation of an distinct object instance

Parameters
objpointer to the memory location of the object
Returns
a notation "typename.hash", where the hash is given as 4 hex digits derived from the memory location

Definition at line 116 of file genfunc.hpp.

Referenced by EventMatch::argPos(), MockElm::buildMutator(), EventLog::call(), EventLog::getID(), and TestNexus::routeAdd().

+ Here is the caller graph for this function:

◆ generateSymbolicID()

string lib::idi::generateSymbolicID ( )
inline

build a per-type identifier, with type prefix and running counter.

Returns
a type based prefix, followed by an instance number
Note
we use the short prefix without namespace, not necessarily unique
Todo:
consequently the generated IDs might clash for two distinct types, which generate the same namePrefix(). Is this a problem?
Warning
this operation is not exactly cheap; it acquires a lock for the counter and, after increasing and dropping the lock, it builds and uses a boost::format instance.

Definition at line 136 of file genfunc.hpp.

◆ generateExtendedID()

string lib::idi::generateExtendedID ( string  prefix = "")
inline

build a long type based identifier, with running counter and custom prefix.

Parameters
prefixoptional prefix to prepend to the generated ID
Returns
a ID string based on the full type, followed by an instance number
Warning
for one, like generateSymbolicID(), this operation is not really cheap. And then, since the type ID is slightly abbreviated and then mangled, there is still the possibility of occasional clashes.

Definition at line 150 of file genfunc.hpp.

◆ getTypeHash()

HashVal lib::idi::getTypeHash ( )
inline
Returns
a standard hash value, based on the full (mangled) C++ type name

Definition at line 160 of file genfunc.hpp.