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