Go to the documentation of this file.
28 #ifndef __OGRE_PROPERTY_H__
29 #define __OGRE_PROPERTY_H__
44 #include <boost/bind.hpp>
45 #include <boost/function.hpp>
147 : mName(name), mDesc(desc), mType(pType) {}
220 template <
typename T>
355 template <
typename T>
359 if (baseProp->
getType() != typeCheck)
370 template <
typename T>
374 if (baseProp->
getType() != typeCheck)
381 refVal =
static_cast<Property<T>*
>(baseProp)->get();
PropertyBase * getProperty(const String &name) const
Gets the property object for a given property name.
#define _OgrePropertyExport
Base interface for an instance of a property.
boost::function< void(T) > setter_func
Ogre::MapIterator< PropertyMap > PropertyIterator
static PropertyType getTypeForValue(const Vector2 &val)
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
map< String, PropertyDef >::type PropertyDefMap
Map from property name to shared definition.
map< String, PropertyValue >::type PropertyValueMap
Defines a transferable map of properties using wrapped value types (Ogre::Any)
Property(PropertyDef *def, getter_func getter, setter_func setter)
Construct a property which is able to directly call a given getter and setter on a specific object in...
void setValue(const String &name, const T *value)
Set a named property value (via pointer to avoid copy).
void removeProperty(const String &name)
Removes the named property from the property set.
void setValue(const String &name, const char *pChar)
Special-case char*, convert to String automatically.
void setValueMap(const PropertyValueMap &values)
Sets the current state from a given value map.
Ogre::Any getValue() const
Return the current value as an Any.
PropertyValueMap getValueMap() const
Gets an independently usable collection of property values from the current state.
static PropertyType getTypeForValue(const unsigned long &val)
A 3x3 matrix which can represent rotations around axes.
Variant type that can hold Any other type.
static PropertyType getTypeForValue(const int &val)
void getValue(const String &name, T &value) const
Get a named property value.
const String & getName() const
Get the name of the property.
static PropertyType getTypeForValue(const String &val)
StringStream StrStreamType
boost::function< T(void) > getter_func
Definition of a property of an object.
static PropertyType getTypeForValue(const ColourValue &val)
A simple structure designed just as a holder of property values between the instances of objects they...
static PropertyType getTypeForValue(const Quaternion &val)
static PropertyType getTypeForValue(const bool &val)
PropertyDef(const String &name, const String &desc, PropertyType pType)
Construct a property.
static PropertyType getTypeForValue(const short &val)
map< String, PropertyBase * >::type PropertyMap
Implementation of a Quaternion, i.e.
PropertyType getType() const
Get the type of the property.
PropertyIterator getPropertyIterator()
Get an iterator over the available properties.
static PropertyType getTypeForValue(const long &val)
Class encapsulating a standard 4x4 homogeneous matrix.
static PropertyType getTypeForValue(const Matrix3 &val)
static PropertyType getTypeForValue(const Vector4 &val)
virtual Ogre::Any getValue() const =0
Return the current value as an Any.
void setPropertyImpl(const String &name, const T &val, PropertyType typeCheck)
Set a named property value, internal implementation (type match required)
Defines a complete set of properties for a single object instance.
const String & getName() const
Get the name of the property.
void setValue(const String &name, T value)
Set a named property value.
Concrete IteratorWrapper for nonconst access to the underlying key-value container.
void addProperty(PropertyBase *prop)
Adds a property to this set.
std::map< K, V, P, A > type
Class representing colour.
4-dimensional homogeneous vector.
PropertyBase(PropertyDef *def)
Constructor.
Standard 2-dimensional vector.
const String & getDescription() const
Get the description of the property.
Property instance with passthrough calls to a given object.
float Real
Software floating point type.
static PropertyType getTypeForValue(const Matrix4 &val)
void getPropertyImpl(const String &name, T &refVal, PropertyType typeCheck) const
Get a named property value, internal implementation (type match required)
static PropertyType getTypeForValue(const Real &val)
PropertyType
The type of a property.
const String & getDescription() const
Get the description of the property.
#define OGRE_EXCEPT(num, desc, src)
static PropertyType getTypeForValue(const unsigned short &val)
static PropertyType getTypeForValue(const unsigned int &val)
Standard 3-dimensional vector.
static PropertyType getTypeForValue(const Vector3 &val)
virtual void set(T val)
Set the property value.
bool hasProperty(const String &name) const
Reports whether this property set contains a named property.
PropertyType getType() const
Get the type of the property.
static const String & getTypeName(PropertyType theType)
Get a string name of a property type.
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.