Crazy Eddie's GUI System  0.8.7
CEGUI::TypedProperty< T > Class Template Referenceabstract

base class for properties able to do native set/get More...

+ Inheritance diagram for CEGUI::TypedProperty< T >:
+ Collaboration diagram for CEGUI::TypedProperty< T >:

Public Types

typedef PropertyHelper< T > Helper
 

Public Member Functions

 TypedProperty (const String &name, const String &help, const String &origin="Unknown", typename Helper::pass_type defaultValue=T(), bool writesXML=true)
 
virtual String get (const PropertyReceiver *receiver) const
 Return the current value of the Property as a String. More...
 
virtual void set (PropertyReceiver *receiver, const String &value)
 Sets the value of the property. More...
 
virtual void setNative (PropertyReceiver *receiver, typename Helper::pass_type value)
 native set method, sets the property given a native type More...
 
virtual Helper::safe_method_return_type getNative (const PropertyReceiver *receiver) const
 native get method, returns the native type by copy More...
 
- Public Member Functions inherited from CEGUI::Property
 Property (const String &name, const String &help, const String &defaultValue="", bool writesXML=true, const String &dataType="Unknown", const String &origin="Unknown")
 Creates a new Property object. More...
 
virtual ~Property (void)
 Destructor for Property objects.
 
const StringgetHelp (void) const
 Return a String that describes the purpose and usage of this Property. More...
 
const StringgetName (void) const
 Return a the name of this Property. More...
 
const StringgetDataType (void) const
 Return string data type of this Property. More...
 
const StringgetOrigin (void) const
 Return string origin of this Property. More...
 
virtual bool isDefault (const PropertyReceiver *receiver) const
 Returns whether the property is at it's default value. More...
 
virtual String getDefault (const PropertyReceiver *receiver) const
 Returns the default value of the Property as a String. More...
 
virtual void writeXMLToStream (const PropertyReceiver *receiver, XMLSerializer &xml_stream) const
 Writes out an XML representation of this class to the given stream. More...
 
virtual bool isReadable () const
 Returns whether the property is readable. More...
 
virtual bool isWritable () const
 Returns whether the property is writable. More...
 
virtual bool doesWriteXML () const
 Returns whether the property writes to XML streams.
 
virtual void initialisePropertyReceiver (PropertyReceiver *) const
 function to allow initialisation of a PropertyReceiver.
 
virtual Propertyclone () const =0
 

Protected Member Functions

virtual void setNative_impl (PropertyReceiver *receiver, typename Helper::pass_type value)=0
 
virtual Helper::safe_method_return_type getNative_impl (const PropertyReceiver *receiver) const =0
 

Additional Inherited Members

- Static Public Attributes inherited from CEGUI::Property
static const String XMLElementName
 
static const String NameXMLAttributeName
 
static const String ValueXMLAttributeName
 
- Protected Attributes inherited from CEGUI::Property
String d_name
 String that stores the Property name.
 
String d_help
 String that stores the Property help text.
 
String d_default
 String that stores the Property default value string.
 
bool d_writeXML
 Specifies whether writeXMLToStream should do anything for this property.
 
String d_dataType
 Holds data type of this property.
 
String d_origin
 Holds origin of this property.
 

Detailed Description

template<typename T>
class CEGUI::TypedProperty< T >

base class for properties able to do native set/get

Todo:
I split this from CEGUIProperty.h to avoid bloating it with PropertyHelper, I also split it from TplProperty since it can be used outside of that. Is that the "right thing" to do?

Member Function Documentation

template<typename T>
virtual String CEGUI::TypedProperty< T >::get ( const PropertyReceiver receiver) const
inlinevirtual

Return the current value of the Property as a String.

Parameters
receiverPointer to the target object.
Returns
String object containing a textual representation of the current value of the Property

Implements CEGUI::Property.

template<typename T>
virtual Helper::safe_method_return_type CEGUI::TypedProperty< T >::getNative ( const PropertyReceiver receiver) const
inlinevirtual

native get method, returns the native type by copy

See also
Property::get

Referenced by CEGUI::TypedProperty< String >::get(), and CEGUI::PropertySet::getProperty().

template<typename T>
virtual void CEGUI::TypedProperty< T >::set ( PropertyReceiver receiver,
const String value 
)
inlinevirtual

Sets the value of the property.

Parameters
receiverPointer to the target object.
valueA String object that contains a textual representation of the new value to assign to the Property.
Returns
Nothing.
Exceptions
InvalidRequestExceptionThrown when the Property was unable to interpret the content of value.

Implements CEGUI::Property.

template<typename T>
virtual void CEGUI::TypedProperty< T >::setNative ( PropertyReceiver receiver,
typename Helper::pass_type  value 
)
inlinevirtual

native set method, sets the property given a native type

See also
Property::set

Referenced by CEGUI::TypedProperty< String >::set(), and CEGUI::PropertySet::setProperty().