Caelum
0.6.4
|
Basic property descriptor interface. More...
#include <TypeDescriptor.h>
Public Member Functions | |
virtual bool | canGetValue () const =0 |
If the value of the property can be read (true means write-only). More... | |
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. More... | |
virtual void | setValue (void *target, const Ogre::Any &value) const =0 |
Set the value of the property packed in an Ogre::Any. More... | |
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. More... | |
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.
|
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 >.
|
pure virtual |
Get the value of the property packed in an Ogre::Any.
target | Object to fetch the property from. If target is not of the correct type behaviour is undefined. |
|
pure virtual |
Set the value of the property packed in an Ogre::Any.
target | Object set the property on. If target is not of the correct type then behaviour is undefined. |
value | New value of the property. |
|
inlinevirtual |
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.