Ase::CustomDataContainer class

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:


        

Derived classes

class GadgetImpl
Base type for classes that have a Property.

Public functions

template <class T>
auto del_custom_data(CustomDataKey<T>* key) →  bool
Delete the current contents of the custom keyed data member, invokes DataKey::destroy.
template <class T>
auto get_custom_data(CustomDataKey<T>* key) const →  T
Retrieve contents of the custom keyed data member, returns DataKey::fallback if nothing was set.
template <class T>
auto has_custom_data(CustomDataKey<T>* key) const →  bool
Retrieve wether contents of the custom keyed data member exists.
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.