osgIntrospection::PropertyInfo Class Reference

This class keeps information about a class' property. More...

Inheritance diagram for osgIntrospection::PropertyInfo:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 PropertyInfo (const Type &decltype, const Type &ptype, const std::string &name, const MethodInfo *getm, const MethodInfo *setm, std::string briefHelp=std::string(), std::string detailedHelp=std::string())
 Direct initialization constructor for simple properties.
 PropertyInfo (const Type &decltype, const Type &ptype, const std::string &name, const MethodInfo *getm, const MethodInfo *setm, const MethodInfo *numm, const MethodInfo *addm, const MethodInfo *insm, const MethodInfo *remm, std::string briefHelp=std::string(), std::string detailedHelp=std::string())
 Direct initialization constructor for "array" properties.
 PropertyInfo (const Type &decltype, const Type &ptype, const std::string &name, const MethodInfo *getm, const MethodInfo *setm, const MethodInfo *remm, std::string briefHelp=std::string(), std::string detailedHelp=std::string())
 Direct initialization constructor for indexed properties.
int getNumIndices () const
 Returns the number of indices.
virtual const
std::string & 
getName () const
 Returns the name of the property being described.
virtual const
std::string & 
getBriefHelp () const
 Returns the brief help of the property being described.
virtual const
std::string & 
getDetailedHelp () const
 Returns the detailed help of the property being described.
virtual const TypegetDeclaringType () const
 Returns the type that declares the property.
const TypegetPropertyType () const
 Returns the type of the reflected property.
const MethodInfogetGetMethod () const
 Returns the getter method.
const MethodInfogetSetMethod () const
 Returns the setter method.
const MethodInfogetCountMethod () const
 Returns the counter method.
const MethodInfogetAddMethod () const
 Returns the adder method.
const MethodInfogetInsertMethod () const
 Returns the insert method.
const MethodInfogetRemoveMethod () const
 Returns the remover method.
bool canGet () const
 Returns whether the property's value can be retrieved.
bool canSet () const
 Returns whether the property's value can be set.
bool canCount () const
 Returns whether the property's array of values can be counted.
bool canAdd () const
 Returns whether items can be added to the array property.
bool canInsert () const
 Returns whether items can be insert to the array property.
bool canRemove () const
 Returns whether items can be removed from the array property.
bool isSimple () const
 Returns whether the property is simple.
bool isIndexed () const
 Returns whether the property is indexed.
bool isArray () const
 Returns whether the property is an array.
const ParameterInfoListgetIndexParameters () const
 Returns the list of index parameters.
void getIndexValueSet (int whichindex, const Value &instance, ValueList &values) const
 Returns a list of valid values that can be used for the specified index.
Value getValue (const Value &instance) const
 Invokes the getter method on the given const instance and returns the property's value.
Value getValue (Value &instance) const
 Invokes the getter method on the given instance and returns the property's value.
void setValue (Value &instance, const Value &value) const
 Invokes the setter method on the given instance and sets the property's value.
Value getIndexedValue (Value &instance, ValueList &indices) const
 Invokes the getter method on the given const instance passing a list of indices and returns the indexed property's value.
Value getIndexedValue (const Value &instance, ValueList &indices) const
 Invokes the getter method on the given instance passing a list of indices and returns the indexed property's value.
void setIndexedValue (Value &instance, ValueList &indices, const Value &value) const
 Invokes the setter method on the given instance passing a list of indices and sets the indexed property's value.
void removeIndexedItem (Value &instance, ValueList &indices) const
 Invokes the remover method on the given instance and removes an item from the indexed property.
int getNumArrayItems (const Value &instance) const
 Invokes the counter method on the given instance and returns the number of items of the array property.
Value getArrayItem (const Value &instance, int i) const
 Invokes the getter method on the given const instance and returns the i-th item of the array property.
Value getArrayItem (Value &instance, int i) const
 Invokes the getter method on the given instance and returns the i-th item of the array property.
void setArrayItem (Value &instance, int i, const Value &value) const
 Invokes the setter method on the given instance and sets the i-th item of the array property.
void addArrayItem (Value &instance, const Value &value) const
 Invokes the adder method on the given instance and adds an item to the array property.
void insertArrayItem (Value &instance, int i, const Value &value) const
 Invokes the insert method on the given instance and inserts an item to the array property after the i-th item of the array property.
void removeArrayItem (Value &instance, int i) const
 Invokes the remover method on the given instance and removes an item from the array property.
Value getDefaultValue () const
 Returns the default value associated to the reflected property.

Protected Member Functions

virtual void getInheritedProviders (CustomAttributeProviderList &providers) const


Detailed Description

This class keeps information about a class' property.

A property is defined by a name and a set of methods that store and retrieve values. When the user wants to "get" the value of a property, the getter method will be invoked and its value returned. When the user wants to "set" the value of a property, the setter method will be called. There are three kinds of property: simple (get/set), indexed (get[i1, i2, ...]/set[i1, i2, ...]), and array (count/add/get[i]/ set[i]). Objects of class PropertyInfo can't be modified once they have been created, but they can be queried without restrictions. You can either retrieve the accessor methods and invoke them manually, or you can call getValue() / setValue() etc. methods to perform direct operations on the property, given an instance of the declaring type to work on. The latter technique is preferred because it checks for custom attributes associated to the PropertyInfo object and passes control to them when needed.


Constructor & Destructor Documentation

osgIntrospection::PropertyInfo::PropertyInfo ( const Type decltype,
const Type ptype,
const std::string &  name,
const MethodInfo getm,
const MethodInfo setm,
std::string  briefHelp = std::string(),
std::string  detailedHelp = std::string() 
) [inline]

Direct initialization constructor for simple properties.

You must pass the Type object associated to the class that declares the property, the Type object that describes the type of the property's value, the property name and the getter/setter methods. Either the setter or the getter can be null, meaning a restricted access. If both are null, the user is expected to add a custom accessor attribute to this PropertyInfo object.

osgIntrospection::PropertyInfo::PropertyInfo ( const Type decltype,
const Type ptype,
const std::string &  name,
const MethodInfo getm,
const MethodInfo setm,
const MethodInfo numm,
const MethodInfo addm,
const MethodInfo insm,
const MethodInfo remm,
std::string  briefHelp = std::string(),
std::string  detailedHelp = std::string() 
) [inline]

Direct initialization constructor for "array" properties.

You must pass the Type object associated to the type that declares the property, the Type object that describes the type of the property's value, the property name and the getter/setter/counter/adder/insert/remover methods.

osgIntrospection::PropertyInfo::PropertyInfo ( const Type decltype,
const Type ptype,
const std::string &  name,
const MethodInfo getm,
const MethodInfo setm,
const MethodInfo remm,
std::string  briefHelp = std::string(),
std::string  detailedHelp = std::string() 
) [inline]

Direct initialization constructor for indexed properties.

You must pass the Type object associated to the class that declares the property, the Type object that describes the type of the property's value, the property name and the getter/setter methods. Either the setter or the getter can be null, meaning a restricted access. If both are null, the user is expected to add a custom accessor attribute to this PropertyInfo object. If the getter method has parameters, the property is considered to be indexed. The same is true if the getter is null and the setter has more than one parameter.


Member Function Documentation

int osgIntrospection::PropertyInfo::getNumIndices (  )  const [inline]

Returns the number of indices.

virtual const std::string& osgIntrospection::PropertyInfo::getName (  )  const [inline, virtual]

Returns the name of the property being described.

virtual const std::string& osgIntrospection::PropertyInfo::getBriefHelp (  )  const [inline, virtual]

Returns the brief help of the property being described.

virtual const std::string& osgIntrospection::PropertyInfo::getDetailedHelp (  )  const [inline, virtual]

Returns the detailed help of the property being described.

virtual const Type& osgIntrospection::PropertyInfo::getDeclaringType (  )  const [inline, virtual]

Returns the type that declares the property.

const Type& osgIntrospection::PropertyInfo::getPropertyType (  )  const [inline]

Returns the type of the reflected property.

const MethodInfo* osgIntrospection::PropertyInfo::getGetMethod (  )  const [inline]

Returns the getter method.

const MethodInfo* osgIntrospection::PropertyInfo::getSetMethod (  )  const [inline]

Returns the setter method.

const MethodInfo* osgIntrospection::PropertyInfo::getCountMethod (  )  const [inline]

Returns the counter method.

const MethodInfo* osgIntrospection::PropertyInfo::getAddMethod (  )  const [inline]

Returns the adder method.

const MethodInfo* osgIntrospection::PropertyInfo::getInsertMethod (  )  const [inline]

Returns the insert method.

const MethodInfo* osgIntrospection::PropertyInfo::getRemoveMethod (  )  const [inline]

Returns the remover method.

bool osgIntrospection::PropertyInfo::canGet (  )  const [inline]

Returns whether the property's value can be retrieved.

bool osgIntrospection::PropertyInfo::canSet (  )  const [inline]

Returns whether the property's value can be set.

bool osgIntrospection::PropertyInfo::canCount (  )  const [inline]

Returns whether the property's array of values can be counted.

bool osgIntrospection::PropertyInfo::canAdd (  )  const [inline]

Returns whether items can be added to the array property.

bool osgIntrospection::PropertyInfo::canInsert (  )  const [inline]

Returns whether items can be insert to the array property.

bool osgIntrospection::PropertyInfo::canRemove (  )  const [inline]

Returns whether items can be removed from the array property.

bool osgIntrospection::PropertyInfo::isSimple (  )  const [inline]

Returns whether the property is simple.

bool osgIntrospection::PropertyInfo::isIndexed (  )  const [inline]

Returns whether the property is indexed.

bool osgIntrospection::PropertyInfo::isArray (  )  const [inline]

Returns whether the property is an array.

const ParameterInfoList& osgIntrospection::PropertyInfo::getIndexParameters (  )  const

Returns the list of index parameters.

If the property is not indexed, this list is empty. If neither the get method nor the set method are defined, this list is empty unless a custom indexing attribute is defined.

void osgIntrospection::PropertyInfo::getIndexValueSet ( int  whichindex,
const Value instance,
ValueList values 
) const

Returns a list of valid values that can be used for the specified index.

If a custom indexing attribute is defined for this property, then it will be queried for the index set, otherwise the index will be treated as an enumeration and the set of enumeration values will be returned.

Value osgIntrospection::PropertyInfo::getValue ( const Value instance  )  const

Invokes the getter method on the given const instance and returns the property's value.

If a custom getter attribute is defined, it will be invoked instead.

Value osgIntrospection::PropertyInfo::getValue ( Value instance  )  const

Invokes the getter method on the given instance and returns the property's value.

If a custom getter attribute is defined, it will be invoked instead.

void osgIntrospection::PropertyInfo::setValue ( Value instance,
const Value value 
) const

Invokes the setter method on the given instance and sets the property's value.

If a custom setter attribute is defined, it will be invoked instead.

Value osgIntrospection::PropertyInfo::getIndexedValue ( Value instance,
ValueList indices 
) const

Invokes the getter method on the given const instance passing a list of indices and returns the indexed property's value.

If a custom getter attribute is defined, it will be invoked instead.

Value osgIntrospection::PropertyInfo::getIndexedValue ( const Value instance,
ValueList indices 
) const

Invokes the getter method on the given instance passing a list of indices and returns the indexed property's value.

If a custom getter attribute is defined, it will be invoked instead.

void osgIntrospection::PropertyInfo::setIndexedValue ( Value instance,
ValueList indices,
const Value value 
) const

Invokes the setter method on the given instance passing a list of indices and sets the indexed property's value.

If a custom setter attribute is defined, it will be invoked instead.

void osgIntrospection::PropertyInfo::removeIndexedItem ( Value instance,
ValueList indices 
) const

Invokes the remover method on the given instance and removes an item from the indexed property.

If a custom remover attribute is defined, it will be invoked instead.

int osgIntrospection::PropertyInfo::getNumArrayItems ( const Value instance  )  const

Invokes the counter method on the given instance and returns the number of items of the array property.

If a custom counter attribute is defined, it will be invoked instead.

Value osgIntrospection::PropertyInfo::getArrayItem ( const Value instance,
int  i 
) const

Invokes the getter method on the given const instance and returns the i-th item of the array property.

If a custom getter attribute us defined, it will be invoked instead.

Value osgIntrospection::PropertyInfo::getArrayItem ( Value instance,
int  i 
) const

Invokes the getter method on the given instance and returns the i-th item of the array property.

If a custom getter attribute us defined, it will be invoked instead.

void osgIntrospection::PropertyInfo::setArrayItem ( Value instance,
int  i,
const Value value 
) const

Invokes the setter method on the given instance and sets the i-th item of the array property.

If a custom setter attribute is defined, it will be invoked instead.

void osgIntrospection::PropertyInfo::addArrayItem ( Value instance,
const Value value 
) const

Invokes the adder method on the given instance and adds an item to the array property.

If a custom adder attribute is defined, it will be invoked instead.

void osgIntrospection::PropertyInfo::insertArrayItem ( Value instance,
int  i,
const Value value 
) const

Invokes the insert method on the given instance and inserts an item to the array property after the i-th item of the array property.

If a custom adder attribute is defined, it will be invoked instead.

void osgIntrospection::PropertyInfo::removeArrayItem ( Value instance,
int  i 
) const

Invokes the remover method on the given instance and removes an item from the array property.

If a custom remover attribute is defined, it will be invoked instead.

Value osgIntrospection::PropertyInfo::getDefaultValue (  )  const

Returns the default value associated to the reflected property.

If no default value has been specified, this method tries to create an instance of the property type and then returns its value. There are some attributes that change the behavior of this method, for example NoDefaultValueAttribute.

virtual void osgIntrospection::PropertyInfo::getInheritedProviders ( CustomAttributeProviderList providers  )  const [protected, virtual]

Implements osgIntrospection::CustomAttributeProvider.


The documentation for this class was generated from the following file:
Generated at Sun Oct 14 02:12:26 2007 for the OpenSceneGraph by doxygen 1.5.3.