#include <Attribute.h>
Public Member Functions | |
AttributeValue< T > & | operator= (const T &value) |
AttributeValue< T > & | operator= (const AttributeValue< T > &value) |
operator T () const | |
void | del () const |
Friends | |
class | Attribute< T > |
Interface class for Attribute<T>::value, providing Python-property-like functionality:
Attribute<int> attr(...);
attr.value = 42; // set the value int i = attr.value; // get the value attr.del(); // remove the attribute
where attr.value is of type AttributeValue<int>.
The setter will create the attribute if it does not exist. The getter will throw an exception if the attribute does not exist. The deleter will not throw an exception if the attribute dos not exist.
void dal::AttributeValue< T >::del | ( | ) | const |
Crudely mimic Python's "del attr.value" (the property's deleter)
dal::AttributeValue< T >::operator T | ( | ) | const |
Getter: allows T y = x.value.
AttributeValue<T>& dal::AttributeValue< T >::operator= | ( | const T & | value | ) |
Setter: allows x.value = (T)y.
AttributeValue<T>& dal::AttributeValue< T >::operator= | ( | const AttributeValue< T > & | value | ) |
Allow x.value = y.value