Data Access Library (DAL)
 All Classes Functions Variables Typedefs Friends
Public Member Functions | Friends
dal::AttributeValue< T > Class Template Reference

#include <Attribute.h>

List of all members.

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 >

Detailed Description

template<typename T>
class dal::AttributeValue< 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.


Member Function Documentation

template<typename T>
void dal::AttributeValue< T >::del ( ) const

Crudely mimic Python's "del attr.value" (the property's deleter)

template<typename T>
dal::AttributeValue< T >::operator T ( ) const

Getter: allows T y = x.value.

template<typename T>
AttributeValue<T>& dal::AttributeValue< T >::operator= ( const T &  value)

Setter: allows x.value = (T)y.

template<typename T>
AttributeValue<T>& dal::AttributeValue< T >::operator= ( const AttributeValue< T > &  value)

Allow x.value = y.value


The documentation for this class was generated from the following file:
 All Classes Functions Variables Typedefs Friends