Ares
Public Member Functions | Private Attributes

Customizable< T > Class Template Reference

#include <src/Utilities/Template.h>

Inheritance diagram for Customizable< T >:
Valueable< T >

List of all members.

Public Member Functions

 Customizable (T *alias=NULL)
void Bind (T *to)
void BindEx (T to)
virtual T Get () const
virtual void Set (T val)
virtual T * GetEx ()
virtual void SetEx (T *val)
void Lock ()
bool operator== (T other) const
bool operator!= (T other) const
bool operator! () const

Private Attributes

bool Customized
T * Default

template<typename T>
class Customizable< T >


Constructor & Destructor Documentation

template<typename T>
Customizable< T >::Customizable ( T *  alias = NULL) [inline]
: Valueable<T>(T()), Customized(false), Default(alias) {};

Member Function Documentation

template<typename T>
void Customizable< T >::Bind ( T *  to) [inline]
                         {
                if(!this->Customized) {
                        this->Default = to;
                }
        }
template<typename T>
void Customizable< T >::BindEx ( to) [inline]
                          {
                if(!this->Customized) {
                        this->Value = to;
                        this->Default = &this->Value;
                }
        }
template<typename T>
virtual T Customizable< T >::Get ( ) const [inline, virtual]

Reimplemented from Valueable< T >.

                              {
                return this->Customized
                 ? this->Value
                 : this->Default ? *this->Default : T()
                ;
        }
template<typename T>
virtual T* Customizable< T >::GetEx ( ) [inline, virtual]

Reimplemented from Valueable< T >.

                           {
                return this->Customized
                 ? &this->Value
                 : this->Default
                ;
        }
template<typename T>
void Customizable< T >::Lock ( ) [inline]
                    {
                if(!this->Customized) {
                        if(this->Default) {
                                this->Value = *this->Default;
                        }
                        this->Customized = true;
                }
        }
template<typename T>
bool Customizable< T >::operator! ( ) const [inline]

Reimplemented from Valueable< T >.

                                 {
                return this->Get() == 0;
        };
template<typename T>
bool Customizable< T >::operator!= ( other) const [inline]

Reimplemented from Valueable< T >.

                                         {
                return this->Get() != other;
        };
template<typename T>
bool Customizable< T >::operator== ( other) const [inline]
                                         {
                return this->Get() == other;
        };
template<typename T>
virtual void Customizable< T >::Set ( val) [inline, virtual]

Reimplemented from Valueable< T >.

                                {
                this->Customized = true;
                this->Value = val;
        }
template<typename T>
virtual void Customizable< T >::SetEx ( T *  val) [inline, virtual]

Reimplemented from Valueable< T >.

                                   {
                this->Customized = true;
                this->Value = *val;
        }

Member Data Documentation

template<typename T>
bool Customizable< T >::Customized [private]
template<typename T>
T* Customizable< T >::Default [private]

The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines