![]() |
VR-Forces 4.6 Class Documentation
|
Go to the source code of this file.
Functions | |
| template<typename RwType > | |
| RwType * | findVariableBindingWithDefault (DtRwVariableBindings &variableBindings, DtRwVariableBindings &defaultBindings, const DtString &variableName) |
| Finds a RW corresponding to the given variable name, as with the above functions, but also looks in the default variable bindings for a value if none is found in this binding. | |
| template<typename T > | |
| boost::optional< T > | getPropertyValue (const DtReaderWriter *prop) |
| Extracts the value from the given ReaderWriter property. | |
| template<typename 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<typename T > | |
| void | setPropertyValue (DtReaderWriter *prop, T val) |
| Sets the value of the given ReaderWriter property. | |
| template<typename T > | |
| bool | findAndSetPropertyValue (DtReaderWriter &properties, const DtString &propertyName, T val) |
| Finds the ReaderWriter object in the given set of properties with the specified name and sets its value. | |
| template<typename K , typename T > | |
| void | setMapProperty (DtReaderWriter *prop, const std::map< K, T > &l) |
| Sets the values of the given map ReaderWriter property. | |
| template<typename K , typename T > | |
| bool | findAndSetMapProperty (DtReaderWriter &properties, const DtString &propertyName, const std::map< K, T > &m) |
| Finds the ReaderWriter object in the given set of properties with the specified name, checks that it is a map with keys of type K and elements of type T, and sets it. | |
| template<typename T > | |
| boost::optional< T > | findVariableBindingValue (const DtReaderWriter &properties, const DtString &propertyName) |
| Same as findPropertyValue but assumes variable bindings. | |
| template<typename T > | |
| boost::optional< T > | findVariableBindingValue (const DtReaderWriter &properties, const DtReaderWriter &defaultProperties, const DtString &propertyName) |
| Like findPropertyValue, except for variable bindings. | |
| const DtReaderWriter * | findPropertyRw (const DtReaderWriter &properties, const DtString &propertyName) |
| Contains utility functions to make it easier to find and extract data from a set of extended properties. | |
| DtReaderWriter * | findPropertyRw (DtReaderWriter &properties, const DtString &propertyName) |
| const DtReaderWriter * | findVariableBindingValueRw (const DtReaderWriter &properties, const DtString &propertyName) |
| Same as findPropertyRw but for variable bindings. | |
| DtReaderWriter * | findVariableBindingValueRw (DtReaderWriter &properties, const DtString &propertyName) |
| template<typename 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<typename SpecificRwType > | |
| SpecificRwType * | findProperty (DtReaderWriter &properties, const DtString &propertyName) |
| template<typename SpecificRwType > | |
| const SpecificRwType * | findTypedProperty (const DtReaderWriter &properties, const DtString &propertyName) |
| Same as findProperty() but with a specific name to avoid name conflicts in some use cases. | |
| template<typename SpecificRwType > | |
| SpecificRwType * | findTypedProperty (DtReaderWriter &properties, const DtString &propertyName) |
| template<typename SpecificRwType > | |
| SpecificRwType * | addProperty (DtReaderWriter &properties, const DtString &propertyName) |
| Adds a property with the specified name to the given set of properties. | |
| template<typename T > | |
| void | setListProperty (DtReaderWriter *prop, const std::list< T > &l) |
| Sets the values of the given list ReaderWriter property. | |
| template<typename T > | |
| void | setListProperty (DtReaderWriter *prop, const std::vector< T > &l) |
| template<typename T > | |
| bool | findAndSetListProperty (DtReaderWriter &properties, const DtString &propertyName, const std::list< T > &l) |
| Finds the ReaderWriter object in the given set of properties with the specified name, checks that it is a list with elements of type T, and sets it. | |
| template<typename T > | |
| bool | findAndSetListProperty (DtReaderWriter &properties, const DtString &propertyName, const std::vector< T > &l) |
| const DtReaderWriter * | findMapItemRw (const DtRwPropertiesMap &propertiesMap, const DtString &itemName) |
| Finds the generic ReaderWriter object in the given DtRwPropertiesMap that matches the specified name. | |
| DtReaderWriter * | findMapItemRw (DtRwPropertiesMap &propertiesMap, const DtString &itemName) |
| template<typename SpecificRwType > | |
| const SpecificRwType * | findMapItem (const DtRwPropertiesMap &propertiesMap, const DtString &itemName) |
| Finds the ReaderWriter object in the given DtRwPropertiesMap that matches the specified name. | |
| template<typename SpecificRwType > | |
| SpecificRwType * | findMapItem (DtRwPropertiesMap &propertiesMap, const DtString &itemName) |
|
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.
|
inline |
|
inline |
Same as findPropertyRw but for variable bindings.
|
inline |
| RwType* findVariableBindingWithDefault | ( | DtRwVariableBindings & | variableBindings, |
| DtRwVariableBindings & | defaultBindings, | ||
| const DtString & | variableName | ||
| ) |
Finds a RW corresponding to the given variable name, as with the above functions, but also looks in the default variable bindings for a value if none is found in this binding.
Returns null if nothing is found in either place.
| 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.
| SpecificRwType* findProperty | ( | DtReaderWriter & | properties, |
| const DtString & | propertyName | ||
| ) |
| const SpecificRwType* findTypedProperty | ( | const DtReaderWriter & | properties, |
| const DtString & | propertyName | ||
| ) |
Same as findProperty() but with a specific name to avoid name conflicts in some use cases.
| SpecificRwType* findTypedProperty | ( | DtReaderWriter & | properties, |
| const DtString & | propertyName | ||
| ) |
| SpecificRwType* addProperty | ( | DtReaderWriter & | properties, |
| const DtString & | propertyName | ||
| ) |
Adds a property with the specified name to the given set of properties.
SpecificRwType must be a subclass of DtPropertyInterface and DtReaderWriter. Returns a pointer to the new item. Returns a null pointer if a property with that name already existed.
Referenced by makVrf::DtSetStatePropertyDialog::setupGui().
| 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!";
| 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().
| void setPropertyValue | ( | DtReaderWriter * | prop, |
| T | val | ||
| ) |
Sets the value of 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).
| bool findAndSetPropertyValue | ( | DtReaderWriter & | properties, |
| const DtString & | propertyName, | ||
| T | val | ||
| ) |
Finds the ReaderWriter object in the given set of properties with the specified name and sets its value.
This effectively a convenience function for calling findPropertyRw() and setPropertyValue(). Only works with simple data types (i.e. numerical values, bools, strings). Returns false if no property with that name can be found.
| void setListProperty | ( | DtReaderWriter * | prop, |
| const std::list< T > & | l | ||
| ) |
Sets the values of the given list ReaderWriter property.
| void setListProperty | ( | DtReaderWriter * | prop, |
| const std::vector< T > & | l | ||
| ) |
| bool findAndSetListProperty | ( | DtReaderWriter & | properties, |
| const DtString & | propertyName, | ||
| const std::list< T > & | l | ||
| ) |
Finds the ReaderWriter object in the given set of properties with the specified name, checks that it is a list with elements of type T, and sets it.
This effectively a convenience function for calling findPropertyRw() and setting each item in the list. Only works with lists of simple data types (i.e. numerical values, bools, strings). Returns false if no property with that name can be found.
| bool findAndSetListProperty | ( | DtReaderWriter & | properties, |
| const DtString & | propertyName, | ||
| const std::vector< T > & | l | ||
| ) |
| void setMapProperty | ( | DtReaderWriter * | prop, |
| const std::map< K, T > & | l | ||
| ) |
Sets the values of the given map ReaderWriter property.
| bool findAndSetMapProperty | ( | DtReaderWriter & | properties, |
| const DtString & | propertyName, | ||
| const std::map< K, T > & | m | ||
| ) |
Finds the ReaderWriter object in the given set of properties with the specified name, checks that it is a map with keys of type K and elements of type T, and sets it.
This effectively a convenience function for calling findPropertyRw() and setting each item in the map. Only works with lists of simple data types (i.e. numerical values, bools, strings). Returns false if no property with that name can be found.
| boost::optional<T> findVariableBindingValue | ( | const DtReaderWriter & | properties, |
| const DtString & | propertyName | ||
| ) |
Same as findPropertyValue but assumes variable bindings.
| boost::optional<T> findVariableBindingValue | ( | const DtReaderWriter & | properties, |
| const DtReaderWriter & | defaultProperties, | ||
| const DtString & | propertyName | ||
| ) |
Like findPropertyValue, except for variable bindings.
|
inline |
Finds the generic ReaderWriter object in the given DtRwPropertiesMap that matches the specified name.
|
inline |
| 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.
| SpecificRwType* findMapItem | ( | DtRwPropertiesMap & | propertiesMap, |
| const DtString & | itemName | ||
| ) |