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();
#define _OgrePropertyExport
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Variant type that can hold Any other type.
Class representing colour.
Concrete IteratorWrapper for nonconst access to the underlying key-value container.
A 3x3 matrix which can represent rotations around axes.
Class encapsulating a standard 4x4 homogeneous matrix.
Base interface for an instance of a property.
virtual Ogre::Any getValue() const =0
Return the current value as an Any.
const String & getDescription() const
Get the description of the property.
PropertyType getType() const
Get the type of the property.
const String & getName() const
Get the name of the property.
PropertyBase(PropertyDef *def)
Constructor.
Definition of a property of an object.
static PropertyType getTypeForValue(const Vector4 &val)
static PropertyType getTypeForValue(const unsigned short &val)
static PropertyType getTypeForValue(const Quaternion &val)
static PropertyType getTypeForValue(const ColourValue &val)
static const String & getTypeName(PropertyType theType)
Get a string name of a property type.
static PropertyType getTypeForValue(const unsigned int &val)
static PropertyType getTypeForValue(const bool &val)
static PropertyType getTypeForValue(const String &val)
PropertyDef(const String &name, const String &desc, PropertyType pType)
Construct a property.
PropertyType getType() const
Get the type of the property.
const String & getDescription() const
Get the description of the property.
static PropertyType getTypeForValue(const Matrix3 &val)
static PropertyType getTypeForValue(const Vector3 &val)
static PropertyType getTypeForValue(const Vector2 &val)
static PropertyType getTypeForValue(const Matrix4 &val)
static PropertyType getTypeForValue(const Real &val)
static PropertyType getTypeForValue(const int &val)
static PropertyType getTypeForValue(const unsigned long &val)
static PropertyType getTypeForValue(const long &val)
const String & getName() const
Get the name of the property.
static PropertyType getTypeForValue(const short &val)
Defines a complete set of properties for a single object instance.
void setPropertyImpl(const String &name, const T &val, PropertyType typeCheck)
Set a named property value, internal implementation (type match required)
void setValueMap(const PropertyValueMap &values)
Sets the current state from a given value map.
void getValue(const String &name, T &value) const
Get a named property value.
map< String, PropertyBase * >::type PropertyMap
PropertyIterator getPropertyIterator()
Get an iterator over the available properties.
void removeProperty(const String &name)
Removes the named property from the property set.
void addProperty(PropertyBase *prop)
Adds a property to this set.
void setValue(const String &name, T value)
Set a named property value.
Ogre::MapIterator< PropertyMap > PropertyIterator
PropertyBase * getProperty(const String &name) const
Gets the property object for a given property name.
void getPropertyImpl(const String &name, T &refVal, PropertyType typeCheck) const
Get a named property value, internal implementation (type match required)
void setValue(const String &name, const T *value)
Set a named property value (via pointer to avoid copy).
PropertyValueMap getValueMap() const
Gets an independently usable collection of property values from the current state.
void setValue(const String &name, const char *pChar)
Special-case char*, convert to String automatically.
bool hasProperty(const String &name) const
Reports whether this property set contains a named property.
Property instance with passthrough calls to a given object.
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...
boost::function< void(T) > setter_func
Ogre::Any getValue() const
Return the current value as an Any.
boost::function< T(void) > getter_func
virtual void set(T val)
Set the property value.
Implementation of a Quaternion, i.e.
StringStream StrStreamType
Standard 2-dimensional vector.
Standard 3-dimensional vector.
4-dimensional homogeneous vector.
#define OGRE_EXCEPT(num, desc, src)
PropertyType
The type of a property.
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)
float Real
Software floating point type.
A simple structure designed just as a holder of property values between the instances of objects they...
std::map< K, V, P, A > type