Public Types | Static Public Member Functions

object_identifier< ObjectType > Struct Template Reference

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

Detailed Description

template<typename ObjectType>
struct viennadata::config::object_identifier< ObjectType >

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(); } };

Template Parameters:
ObjectType The type of the object the data is associated with

Member Typedef Documentation

typedef const ObjectType* id_type

Member Function Documentation

static id_type get ( ObjectType const &  obj  )  [inline, static]

per default, the element address is the id


The documentation for this struct was generated from the following file: