Caelum::ValuePropertyDescriptor Class Reference

Basic property descriptor interface. More...

#include <TypeDescriptor.h>

Inheritance diagram for Caelum::ValuePropertyDescriptor:

Caelum::TypedValuePropertyDescriptor< ValueT > Caelum::TypedValuePropertyDescriptor< ParamT > Caelum::AccesorPropertyDescriptor< TargetT, ParamT, InParamT, OutParamT >

List of all members.

Public Member Functions

virtual bool canGetValue () const =0
 If the value of the property can be read (true means write-only).
virtual bool canSetValue () const =0
 If the value of the property can be set (false means read-only).
virtual const Ogre::Any getValue (const void *target) const =0
 Get the value of the property packed in an Ogre::Any.
virtual void setValue (void *target, const Ogre::Any &value) const =0
 Set the value of the property packed in an Ogre::Any.
virtual const std::type_info & getValueTypeId () const =0
 Get std::type_info for the type of the value.
virtual bool implementsTypedValuePropertyDescriptor () const
 Check if this class also implements TypedValuePropertyDescriptor.


Detailed Description

Basic property descriptor interface.

A property descriptor provides a uniform way to change the value of a simple property. The values are safely wrapped inside an Ogre::Any.

This only works for simple properties which are copied by value. This includes floats strings and vectors but not things like Entity pointers.

All public methods are const because the descriptor itself is not modified by these methods.

Definition at line 83 of file TypeDescriptor.h.


Member Function Documentation

virtual bool Caelum::ValuePropertyDescriptor::canGetValue (  )  const [pure virtual]

If the value of the property can be read (true means write-only).

This is false for write-only properties. Write-only properties are generally a bad idea but they are supported. Scripting (with .os files) doesn't actually require reading existing values.

Implemented in Caelum::AccesorPropertyDescriptor< TargetT, ParamT, InParamT, OutParamT >.

virtual const Ogre::Any Caelum::ValuePropertyDescriptor::getValue ( const void *  target  )  const [pure virtual]

Get the value of the property packed in an Ogre::Any.

Parameters:
target Object to fetch the property from. If target is not of the correct type behaviour is undefined.

virtual void Caelum::ValuePropertyDescriptor::setValue ( void *  target,
const Ogre::Any &  value 
) const [pure virtual]

Set the value of the property packed in an Ogre::Any.

Parameters:
target Object set the property on. If target is not of the correct type then behaviour is undefined.
value New value of the property.

virtual bool Caelum::ValuePropertyDescriptor::implementsTypedValuePropertyDescriptor (  )  const [inline, virtual]

Check if this class also implements TypedValuePropertyDescriptor.

If this property returns true then you can static_cast this object to a TypedValuePropertyDescriptor<ValueT>; for the appropiate ValueT. The appropriate ValueT can be obtained with getValueTypeId.

Definition at line 122 of file TypeDescriptor.h.


The documentation for this class was generated from the following file:

Generated on Sun Aug 9 10:24:22 2009 for Caelum by  doxygen 1.5.9