VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
propertyUtils.h File Reference

Go to the source code of this file.

Functions

const DtReaderWriterfindPropertyRw (const DtReaderWriter &properties, const DtString &propertyName)
 Contains utility functions to make it easier to find and extract data from a set of extended properties.
DtReaderWriterfindPropertyRw (DtReaderWriter &properties, const DtString &propertyName)
const DtReaderWriterfindVariableBindingValueRw (const DtReaderWriter &properties, const DtString &propertyName)
 Same as findPropertyRw but for variable bindings.
DtReaderWriterfindVariableBindingValueRw (DtReaderWriter &properties, const DtString &propertyName)
template<class SpecificRwType >
const SpecificRwType * findProperty (const DtReaderWriter &properties, const DtString &propertyName)
 Finds the ReaderWriter object in the given set of properties with the specified name.
template<class SpecificRwType >
SpecificRwType * findProperty (DtReaderWriter &properties, const DtString &propertyName)
template<class T >
boost::optional< T > getPropertyValue (const DtReaderWriter *prop)
 Extracts the value from the given ReaderWriter property.
template<class T >
boost::optional< T > findPropertyValue (const DtReaderWriter &properties, const DtString &propertyName)
 Finds the ReaderWriter object in the given set of properties with the specified name and returns its value.
template<class T >
boost::optional< T > findVariableBindingValue (const DtReaderWriter &properties, const DtString &propertyName)
 Same as findPropertyValue but assumes variable bindings.
template<class T >
boost::optional< T > findVariableBindingValue (const DtReaderWriter &properties, const DtReaderWriter &defaultProperties, const DtString &propertyName)
 Like findPropertyValue, except for variable bindings.
const DtReaderWriterfindMapItemRw (const DtRwPropertiesMap &propertiesMap, const DtString &itemName)
 Finds the generic ReaderWriter object in the given DtRwPropertiesMap that matches the specified name.
DtReaderWriterfindMapItemRw (DtRwPropertiesMap &propertiesMap, const DtString &itemName)
template<class SpecificRwType >
const SpecificRwType * findMapItem (const DtRwPropertiesMap &propertiesMap, const DtString &itemName)
 Finds the ReaderWriter object in the given DtRwPropertiesMap that matches the specified name.
template<class SpecificRwType >
SpecificRwType * findMapItem (DtRwPropertiesMap &propertiesMap, const DtString &itemName)

Detailed Description

Function Documentation

const DtReaderWriter* findPropertyRw ( const DtReaderWriter properties,
const DtString propertyName 
)
inline

Contains utility functions to make it easier to find and extract data from a set of extended properties.

Finds the generic ReaderWriter object in the given set of properties with the specified name.

DtReaderWriter* findPropertyRw ( DtReaderWriter properties,
const DtString propertyName 
)
inline
const DtReaderWriter* findVariableBindingValueRw ( const DtReaderWriter properties,
const DtString propertyName 
)
inline

Same as findPropertyRw but for variable bindings.

DtReaderWriter* findVariableBindingValueRw ( DtReaderWriter properties,
const DtString propertyName 
)
inline
template<class SpecificRwType >
const SpecificRwType* findProperty ( const DtReaderWriter properties,
const DtString propertyName 
)

Finds the ReaderWriter object in the given set of properties with the specified name.

Then verifies that the ReaderWriter matches the type specified as the template argument. Returns a valid pointer if successful.

template<class SpecificRwType >
SpecificRwType* findProperty ( DtReaderWriter properties,
const DtString propertyName 
)
template<class T >
boost::optional<T> getPropertyValue ( const DtReaderWriter prop)

Extracts the value from the given ReaderWriter property.

The template parameter type must be an appropriate storage type for the property value. Cannot be used for ReaderWriter properties of complex types (structures, lists, and maps). Returns a boost::optional object, which can be dereferenced like a pointer to get the value. If a value could not be retrieved for any reason, the return value will be uninitialized, which can be checked (using the capabilities of boost::optional) like so: boost::optional<someType> r = getPropertyValue(prop); if(r) cout << "Value returned!"; else cout << "No value returned!";

template<class T >
boost::optional<T> findPropertyValue ( const DtReaderWriter properties,
const DtString propertyName 
)

Finds the ReaderWriter object in the given set of properties with the specified name and returns its value.

This effectively a convenience function for calling findPropertyRw() and getPropertyValue().

template<class T >
boost::optional<T> findVariableBindingValue ( const DtReaderWriter properties,
const DtString propertyName 
)

Same as findPropertyValue but assumes variable bindings.

template<class T >
boost::optional<T> findVariableBindingValue ( const DtReaderWriter properties,
const DtReaderWriter defaultProperties,
const DtString propertyName 
)

Like findPropertyValue, except for variable bindings.

const DtReaderWriter* findMapItemRw ( const DtRwPropertiesMap propertiesMap,
const DtString itemName 
)
inline

Finds the generic ReaderWriter object in the given DtRwPropertiesMap that matches the specified name.

DtReaderWriter* findMapItemRw ( DtRwPropertiesMap propertiesMap,
const DtString itemName 
)
inline
template<class SpecificRwType >
const SpecificRwType* findMapItem ( const DtRwPropertiesMap propertiesMap,
const DtString itemName 
)

Finds the ReaderWriter object in the given DtRwPropertiesMap that matches the specified name.

Then verifies that the ReaderWriter matches the type specified as the template argument. Returns a valid pointer if successful.

template<class SpecificRwType >
SpecificRwType* findMapItem ( DtRwPropertiesMap propertiesMap,
const DtString itemName 
)

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)