Traits class that specifies the object identification mechanism. More...
#include <object_identifier.hpp>
Public Types | |
typedef pointer_based_id | tag |
typedef const ObjectType * | id_type |
Static Public Member Functions | |
static id_type | get (ObjectType const &obj) |
per default, the element address is the id |
Traits class that specifies the object identification mechanism.
Custom identification mechanisms can be provided by proper specializations. Requirements:
E.g. for a class SomeClass that provides a member function int getID(), one writes
template <> struct element_identifier<SomeClass> { typedef element_provided_id tag; typedef int id_type;
static id_type get(SomeClass const & el) { return el.getID(); } };
ObjectType | The type of the object the data is associated with |
typedef const ObjectType* id_type |
typedef pointer_based_id tag |
static id_type get | ( | ObjectType const & | obj | ) | [inline, static] |
per default, the element address is the id