Lumiera  0.pre.03
»edityourfreedom«
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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

 format
 
 test
 

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...
 

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)
 
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

bool lib::idi::operator== ( BareEntryID const &  i1,
BareEntryID const &  i2 
)
inline

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

References BareEntryID::getHash().

+ Here is the call graph for this function:

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 87 of file genfunc.hpp.

References lib::meta::primaryTypeComponent().

+ Here is the call graph for this function:

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 99 of file genfunc.hpp.

References lib::meta::sanitisedFullTypeName().

+ Here is the call graph for this function:

string lib::idi::categoryFolder ( )
inline

Definition at line 106 of file genfunc.hpp.

string lib::idi::namePrefix ( )
inline

Definition at line 113 of file genfunc.hpp.

Referenced by StructFactoryImpl::createIdent().

+ Here is the caller graph for this function:

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

designation of an distinct object instance

obj pointer 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 125 of file genfunc.hpp.

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

Referenced by EventLog::call(), EventLog::clear(), MockElm::identify(), AbstractTangible_test::memLocation(), EventMatch::on(), Nexus::operator string(), TestEventLog_test::verify_callLogging(), and TestEventLog_test::verify_simpleUsage().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 142 of file genfunc.hpp.

References TypedCounter::inc(), and lib::idi::format::instance_format().

+ Here is the call graph for this function:

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 157 of file genfunc.hpp.

References TypedCounter::inc(), and lib::idi::format::instance_format().

+ Here is the call graph for this function:

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

Definition at line 168 of file genfunc.hpp.