VCF::Property Class Reference
The Property class represents a member attribute of a class. More...
#include <vcf/FoundationKit/Property.h>
Public Member Functions | |
| Property () | |
| Property (const Property &prop) | |
| virtual | ~Property () |
| Property & | operator= (const Property &rhs) |
| virtual Property * | clone ()=0 |
| makes a copy of the property. | |
| String | getName () const |
| gets the name of the property. | |
| String | getDisplayName () const |
| returns the display name, usually something longer and more descriptive than the name alone. | |
| String | getDescription () const |
| gets a description of the property, telling what the property does or represents. | |
| void | setDescription (const String &description) |
| sets the description of the property | |
| void | setDisplayName (const String &displayName) |
| sets the display name of the property | |
| void | setName (const String &name) |
| sets the name of the property | |
| virtual String | getTypeClassName ()=0 |
| This function returns the class name of the property's type. | |
| PropertyDescriptorType | getType () const |
| returns the type of the Property. | |
| void | setType (const PropertyDescriptorType &type) |
| sets the type of the Property | |
| virtual VariantData * | get (Object *source)=0 |
| gets the value of the property for the given instance of source. | |
| virtual void | set (Object *source, VariantData *value)=0 |
| sets a value on an object. | |
| virtual String | toString () |
| void | setSource (Object *source) |
| sets the source for the Property instance. | |
| void | setSource (const Object *source) |
| Object * | getSource () |
| returns the object source that is associated with this property instance. | |
| VariantData * | get () |
| returns a VariandData object that represents the value of this property on the source object that was specified in the setSource() method. | |
| void | set (VariantData *value) |
| sets the value specified in the VariantData object passed in on the source obejct that was specified in the setSource() method. | |
| virtual void | set (Object *source, const String &value) |
| calls the value_'s setFromString method which converts the string into the right type and then calls set() | |
| void | set (const String &value) |
| convenience method for calling set on propertys that have their source assigned to a valid pointer. | |
| bool | isCollection () |
| Indicates whether or not the property is a collection. | |
| virtual uint32 | getCollectionCount () |
| Returns the number of elements in the property's collection. | |
| virtual uint32 | getCollectionCount (const VariantData &key) |
| virtual uint32 | getCollectionCount (Object *source) |
| virtual uint32 | getCollectionCount (Object *source, const VariantData &key) |
| virtual uint32 | getCollectionKeys (Object *source, std::vector< VariantData > &keys) |
| virtual VariantData * | getAtKey (const VariantData &key) |
| Returns the element at the specified key. | |
| virtual VariantData * | getAtKey (const VariantData &key, Object *source) |
| Returns the element of the collection at the specified index. | |
| virtual void | setAtKey (const VariantData &key, VariantData *value) |
| Sets the value of the element at the specified index. | |
| virtual void | setAtKey (const VariantData &key, const String &value) |
| virtual void | setAtKey (const VariantData &key, VariantData *value, Object *source) |
| virtual void | setAtKey (const VariantData &key, const String &value, Object *source) |
| void | add (VariantData *value) |
| Adds an element to the property collection. | |
| virtual void | add (Object *source, VariantData *value) |
| Adds an element to the property collection. | |
| virtual void | insert (const VariantData &key, VariantData *value, Object *source) |
| Inserts an element into the property collection. | |
| void | insert (const VariantData &key, VariantData *value) |
| Inserts an element into the property collection. | |
| virtual void | remove (const VariantData &key, Object *source) |
| Removes an element from the property collection at the specified index. | |
| void | remove (const VariantData &key) |
| Removes an element from the property collection at the specified index. | |
| virtual bool | collectionSupportsEditing () |
| This indicates whether or not the property for the collection will allow any modifications (add/insert/remove) to take place. | |
| bool | isReadOnly () |
| PropertyChanged bool | isBound () |
| returns whether or not the property is "bound" to an object. | |
| void | setBound (const bool &bound) |
| uint32 | sizeOf () const |
Public Attributes | |
| VCF::Delegate | PropertyChangeDelegate |
Protected Attributes | |
| VariantData | value_ |
| bool | isCollection_ |
| bool | isReadOnly_ |
Detailed Description
The Property class represents a member attribute of a class.Properties allow a programmer to dynamically query a class at runtime for all of it attributes with out knowing the exact type of class the object instance is. Property is an abstract base class, and only provides an interface to work with.
- Author:
- Jim Crafton
- Version:
- 1.0
Constructor & Destructor Documentation
|
|
|
|
|
|
|
|
|
Member Function Documentation
|
||||||||||||
|
Adds an element to the property collection. Note that the default implementation is to do nothing. Implementers will need to reimplement this function to provide for correct behavior. |
|
|
Adds an element to the property collection.
|
|
|
makes a copy of the property. Implemented in the templated derived classes. |
|
|
This indicates whether or not the property for the collection will allow any modifications (add/insert/remove) to take place. The default behavior is to disallow these functions. |
|
|
returns a VariandData object that represents the value of this property on the source object that was specified in the setSource() method.
|
|
|
gets the value of the property for the given instance of source.
|
|
||||||||||||
|
Returns the element of the collection at the specified index. If the index is out of bounds (greater than or equal to the total number of elements in the collection) then an exception is thrown. |
|
|
Returns the element at the specified key. Typically this is an index into some array like container, but it's possibly it could be a key into a container like a map or Dictionary. |
|
||||||||||||
|
|
|
|
|
|
|
|
|
|
Returns the number of elements in the property's collection.
|
|
||||||||||||
|
|
|
|
gets a description of the property, telling what the property does or represents.
|
|
|
returns the display name, usually something longer and more descriptive than the name alone.
|
|
|
gets the name of the property.
|
|
|
returns the object source that is associated with this property instance.
|
|
|
returns the type of the Property. These are the same types as VariantData::type. They can be int, long, uint32, short, float, double, char, bool, string, enums or Object*. |
|
|
This function returns the class name of the property's type. For primitive types it will return the primitive type name, i.e. for a property of type long it will return "long", while a property of type Color will return "VCF::Color".
|
|
||||||||||||
|
Inserts an element into the property collection. Note that the default implementation is to do nothing. Implementers will need to reimplement this function to provide for correct behavior. |
|
||||||||||||||||
|
Inserts an element into the property collection. Note that the default implementation is to do nothing. Implementers will need to reimplement this function to provide for correct behavior. |
|
|
returns whether or not the property is "bound" to an object. "Bound" properties cause a onPropertyChanged() method to be fired in any listeners whenever the property's set() method is called |
|
|
Indicates whether or not the property is a collection. Most properties will obviously return false. If the property supports a collection, then it should return true. |
|
|
|
|
|
|
|
|
Removes an element from the property collection at the specified index. Note that the default implementation is to do nothing. Implementers will need to reimplement this function to provide for correct behavior. |
|
||||||||||||
|
Removes an element from the property collection at the specified index. Note that the default implementation is to do nothing. Implementers will need to reimplement this function to provide for correct behavior. |
|
|
convenience method for calling set on propertys that have their source assigned to a valid pointer.
|
|
||||||||||||
|
calls the value_'s setFromString method which converts the string into the right type and then calls set()
|
|
|
sets the value specified in the VariantData object passed in on the source obejct that was specified in the setSource() method.
|
|
||||||||||||
|
sets a value on an object.
|
|
||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
Sets the value of the element at the specified index. If the index is out of bounds (greater than or equal to the total number of elements in the collection) then an exception is thrown.
|
|
|
|
|
|
sets the description of the property
|
|
|
sets the display name of the property
|
|
|
sets the name of the property
|
|
|
|
|
|
sets the source for the Property instance.
|
|
|
sets the type of the Property
|
|
|
|
|
|
|
Member Data Documentation
|
|
|
|
|
|
|
|
|
|
|
|
The documentation for this class was generated from the following file:
- vcf/FoundationKit/Property.h
