Caelum  0.6.4
Public Member Functions | List of all members
Caelum::ValuePropertyDescriptor Class Referenceabstract

Basic property descriptor interface. More...

#include <TypeDescriptor.h>

Inheritance diagram for Caelum::ValuePropertyDescriptor:
[legend]

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...
 

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.

Member Function Documentation

◆ canGetValue()

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 >.

◆ getValue()

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
targetObject to fetch the property from. If target is not of the correct type behaviour is undefined.

◆ setValue()

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
targetObject set the property on. If target is not of the correct type then behaviour is undefined.
valueNew value of the property.

◆ implementsTypedValuePropertyDescriptor()

virtual bool Caelum::ValuePropertyDescriptor::implementsTypedValuePropertyDescriptor ( ) const
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.