Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
genfunc.hpp File Reference

Generic functions to build identification schemes. More...

Go to the source code of this file.

Description

Generic functions to build identification schemes.

These template functions are meant as common extension point. The purpose is to streamline and disentangle the various identification schemes in use at various places within Lumiera. We strive to cover all the common basic usage situations through these functions

  • build a symbolic ID
  • build a classification record
  • create a readable yet unique ID
  • render an ID in human readable form
  • derive a hash function

    Todo:

    better unit test coverage

    improve implementation of typeFullID

    See also
    GenericIdFunction_test
    EntryID

Definition in file genfunc.hpp.

#include "lib/hash-value.h"
#include "lib/symbol.hpp"
#include "lib/typed-counter.hpp"
#include <typeinfo>
#include <string>

Namespaces

namespace  lib
 Implementation namespace for support and library code.
 
namespace  lib::meta
 
namespace  lib::idi
 Identification Schemes.
 
namespace  lib::idi::format
 

Functions

string demangleCxx (Literal rawName)
 Fallback type-ID:
 
string humanReadableTypeID (lib::Literal)
 pretty-print an internal C++ type representation
 
string primaryTypeComponent (lib::Literal)
 extract core name component from a raw type spec
 
string sanitisedFullTypeName (lib::Literal)
 build a sanitised ID from full type name
 
string instance_format (string const &prefix, size_t instanceNr)
 
string instance_hex_format (string const &prefix, size_t instanceNr)
 
template<typename TY >
string typeSymbol ()
 Short readable type identifier, not necessarily unique or complete.
 
template<typename TY >
string typeFullID ()
 Complete unique type identifier.
 
template<typename TY >
string categoryFolder ()
 
template<typename TY >
string namePrefix ()
 
template<typename TY >
string instanceTypeID (const TY *const obj)
 designation of an distinct object instance
 
TypedCountersharedInstanceCounter ()
 
template<class TY >
string generateSymbolicID ()
 build a per-type identifier, with type prefix and running counter.
 
template<class TY >
string generateExtendedID (string prefix="")
 build a long type based identifier, with running counter and custom prefix.
 
template<typename TY >
HashVal getTypeHash ()