#include "utils.hh"
Public Member Functions | |
template<class T > | |
bool | del_custom_data (CustomDataKey< T > *key) |
template<class T > | |
T | get_custom_data (CustomDataKey< T > *key) const |
template<class T > | |
bool | has_custom_data (CustomDataKey< T > *key) const |
template<class T > | |
void | set_custom_data (CustomDataKey< T > *key, T data) |
Protected Member Functions | |
void | custom_data_destroy () |
~CustomDataContainer () | |
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:
|
protected |
|
protected |
void set_custom_data | ( | CustomDataKey< T > * | key, |
T | data | ||
) |
Assign data to the custom keyed data member, deletes any previously set data.
T get_custom_data | ( | CustomDataKey< T > * | key | ) | const |
Retrieve contents of the custom keyed data member, returns DataKey::fallback if nothing was set.
bool has_custom_data | ( | CustomDataKey< T > * | key | ) | const |
Retrieve wether contents of the custom keyed data member exists.
bool del_custom_data | ( | CustomDataKey< T > * | key | ) |
Delete the current contents of the custom keyed data member, invokes DataKey::destroy.