Lumiera  0.pre.03
»edit your freedom«
entry-id.hpp File Reference

Go to the source code of this file.

Description

Bare symbolic and hash ID used for accounting of asset like entries.

This ID can be used to register instances with an accounting table, without all the overhead of creating individual assets for each entry. The datafields in the symbolic part of the ID are similar to the asset identity tuple; the idea is to promote individual entries to full fledged assets on demand. Alongside with the symbolic identity, which can be reduced to just a Symbol and (compile time) type information, we store the derived hash value as LUID.

Note
as of 3/2010 this is an experimental setup and exists somewhat in parallel to the assets. We're still in the process of finding out what's really required to keep track of all the various kinds of objects. ///////////////////TICKET #739
Todo:
as of 11/2018 the basic design seems adequate, but the actual solution looks fishy. Even more so, since we now use subclasses of BareEntryID
  • as identity tag within lib::diff::GenNode
  • as identity tag for all tangible UI elements There are various quirks and hacks to make all of this happen, and especially the hashed-in type information feels gratuitous at places, when all we actually need is a distinct identity plus a human readable symbol.
See also
asset::Asset::Ident
entry-id-test.cpp

Definition in file entry-id.hpp.

#include "lib/error.hpp"
#include "lib/hash-indexed.hpp"
#include "lib/idi/genfunc.hpp"
#include "lib/util.hpp"
#include <boost/functional/hash.hpp>
#include <boost/operators.hpp>
#include <string>

Classes

class  BareEntryID
 type erased baseclass for building a combined hash and symbolic ID. More...
 
struct  EntryID< TY >
 typed symbolic and hash ID for asset-like position accounting. More...
 
struct  EntryID< TY >
 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...
 
struct  BareEntryID::UseEmbeddedHash
 using BareEntryID derived objects as keys within std::unordered_map More...
 

Functions

LuidH buildHash (string const &sym, HashVal seed=0)
 build up a hash value, packaged as LUID. More...
 
bool operator== (BareEntryID const &i1, BareEntryID const &i2)
 

Variables

const size_t KNUTH_MAGIC = 2654435761
 lousy old tinkerer's trick: hash values with poor distribution can be improved by spreading the input with something close to the golden ratio. More...
 

Namespaces

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