Anklang C++ API 0.0.0
Loading...
Searching...
No Matches
CustomDataContainer

#include "utils.hh"

Inheritance diagram for CustomDataContainer:
[legend]

Public Member Functions

template<class T >
booldel_custom_data (CustomDataKey< T > *key)
template<class T >
Tget_custom_data (CustomDataKey< T > *key) const
template<class T >
boolhas_custom_data (CustomDataKey< T > *key) const
template<class T >
voidset_custom_data (CustomDataKey< T > *key, T data)

Protected Member Functions

voidcustom_data_destroy ()
~CustomDataContainer ()

Detailed Description

DataListContainer - typesafe storage and retrieval of arbitrary members. By using a DataKey, DataListContainer objects allow storage and retrieval of custom data members in a typesafe fashion. The custom data members will initially default to DataKey::fallback and are deleted by the DataListContainer destructor. Example:

Constructor & Destructor Documentation

~CustomDataContainer()

~CustomDataContainer ( )
protected

Member Function Documentation

custom_data_destroy()

void custom_data_destroy ( )
protected

set_custom_data()

template<class T >
void set_custom_data ( CustomDataKey< T > * key,
T data
)

Assign data to the custom keyed data member, deletes any previously set data.

get_custom_data()

template<class T >
T get_custom_data ( CustomDataKey< T > * key) const

Retrieve contents of the custom keyed data member, returns DataKey::fallback if nothing was set.

has_custom_data()

template<class T >
bool has_custom_data ( CustomDataKey< T > * key) const

Retrieve wether contents of the custom keyed data member exists.

del_custom_data()

template<class T >
bool del_custom_data ( CustomDataKey< T > * key)

Delete the current contents of the custom keyed data member, invokes DataKey::destroy.