Ares
|
#include <src/Utilities/Template.h>
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 |
Customizable< T >::Customizable | ( | T * | alias = NULL | ) | [inline] |
: Valueable<T>(T()), Customized(false), Default(alias) {};
void Customizable< T >::Bind | ( | T * | to | ) | [inline] |
{ if(!this->Customized) { this->Default = to; } }
void Customizable< T >::BindEx | ( | T | to | ) | [inline] |
{ if(!this->Customized) { this->Value = to; this->Default = &this->Value; } }
virtual T Customizable< T >::Get | ( | ) | const [inline, virtual] |
Reimplemented from Valueable< T >.
{ return this->Customized ? this->Value : this->Default ? *this->Default : T() ; }
virtual T* Customizable< T >::GetEx | ( | ) | [inline, virtual] |
Reimplemented from Valueable< T >.
{ return this->Customized ? &this->Value : this->Default ; }
void Customizable< T >::Lock | ( | ) | [inline] |
{ if(!this->Customized) { if(this->Default) { this->Value = *this->Default; } this->Customized = true; } }
bool Customizable< T >::operator! | ( | ) | const [inline] |
Reimplemented from Valueable< T >.
{ return this->Get() == 0; };
bool Customizable< T >::operator!= | ( | T | other | ) | const [inline] |
Reimplemented from Valueable< T >.
{ return this->Get() != other; };
bool Customizable< T >::operator== | ( | T | other | ) | const [inline] |
{ return this->Get() == other; };
virtual void Customizable< T >::Set | ( | T | val | ) | [inline, virtual] |
Reimplemented from Valueable< T >.
{ this->Customized = true; this->Value = val; }
virtual void Customizable< T >::SetEx | ( | T * | val | ) | [inline, virtual] |
Reimplemented from Valueable< T >.
{ this->Customized = true; this->Value = *val; }
bool Customizable< T >::Customized [private] |
T* Customizable< T >::Default [private] |