Propertized Class Reference

Implements the capability to access internal data via properties. More...

Inheritance diagram for Propertized:

Inheritance graph
[legend]
Collaboration diagram for Propertized:

Collaboration graph
[legend]
List of all members.

Constructors

 Propertized ()
 ~Propertized ()

Interface

template<class T>
void addProperty (const char *name, Variant::types t, T *obj, Variant(T::*read)(), bool(T::*write)(const Variant &)=0)
template<class T>
void addVectorProperty (const char *name, Variant::types t, T *obj, Variant(T::*read)(u_int i), bool(T::*write)(u_int i, const Variant &)=0)
Variant property (const char *name)
bool setProperty (const char *name, const Variant &data)
bool setVectorProperty (const char *name, u_int i, const Variant &data)
void setProperties (PropertySettings &prop)
PropertyAccessVecproperties () const
void propertySettings (PropertySettings &prop) const
AbstractPropertyAccesspropertySearch (const char *name) const
Variant getTypename () const
Variant getTypename ()
Variant convertStringTo (const Variant &str, Variant::types t)
virtual Propertizedclone () const

Protected Member Functions

void setTypename (const char *type)

Detailed Description

Motivation
This class allow to access data of very different type of Cluster, Linker, etc by a unified interface via the concept of 'property'. A property is an attribute of a class identified by a string and accessibile by methods set/getProperty.
Description
Warnings
Properties
Name Type [isVector] Access mode Description Class
typename string read-only Class's type this


Constructor & Destructor Documentation

Propertized (  ) 

Constructor

~Propertized (  ) 

Destructor


Member Function Documentation

void addProperty ( const char *  name,
Variant::types  t,
T *  obj,
Variant(T::*)()  read,
bool(T::*)(const Variant &)  write = 0 
) [inline]

add a property

Warning:
this method doesn't check if a property with name name already exist, so pay attention or previous setting may be overwritten

void addVectorProperty ( const char *  name,
Variant::types  t,
T *  obj,
Variant(T::*)(u_int i)  read,
bool(T::*)(u_int i, const Variant &)  write = 0 
) [inline]

add a property that holds a Vector of Variant

Warning:
this method doesn't check if a property with name name already exist, so pay attention or previous setting may be overwritten

Variant property ( const char *  name  )  [inline]

return the property setted

bool setProperty ( const char *  name,
const Variant data 
) [inline]

set the property

bool setVectorProperty ( const char *  name,
u_int  i,
const Variant data 
) [inline]

set the i-th Variant of the Vector property

void setProperties ( PropertySettings prop  ) 

configure the properties by a PropertySettings

Warning:
This method doesn't reports is some settings fails

PropertyAccessVec& properties (  )  const [inline]

Return all PropertyAccess in order of registering

void propertySettings ( PropertySettings prop  )  const [inline]

Set the PropertySettings reflecting the status of this Propertized

AbstractPropertyAccess* propertySearch ( const char *  name  )  const [inline]

Search for property and return it; if the property doesn't exists a NULL pointer will be returned

Variant getTypename (  )  const [inline]

Return the typename (i.e. the name of the Class)

Variant getTypename (  )  [inline]

Return the typename (i.e. the name of the Class)

Variant convertStringTo ( const Variant str,
Variant::types  t 
)

Create a Variant of type required from String-type Variant passed

Warning:
is not possible convert to pointer-type.

virtual Propertized* clone (  )  const [virtual]

Clone this Propertized

Implements Clonable.

Reimplemented in BiasedCluster, Cluster, CopyLinker, DDECluster, DotLinker, FakeCluster, WinnerTakeAllFunction, IdentityFunction, ScaleFunction, GainFunction, SigmoidFunction, FakeSigmoidFunction, ScaledSigmoidFunction, RampFunction, LinearFunction, StepFunction, LeakyIntegratorFunction, LogLikeFunction, PoolFunction, CompositeFunction, LinearComboFunction, PeriodicFunction, SawtoothFunction, TriangleFunction, SinFunction, PseudoGaussFunction, GaussFunction, Linker, NormLinker, OutputFunction, SimpleCluster, and SparseMatrixLinker.

void setTypename ( const char *  type  )  [protected]

Set the typename
Use this function in all constructor of subclasses, and always set the appropriate typename


The documentation for this class was generated from the following file:
BerliOS Developer Logo Valid XHTML 1.0 Transitional Valid CSS!