#include <osgIntrospection/Value>
#include <osgIntrospection/ReaderWriter>
#include <sstream>
Namespaces | |
namespace | osgIntrospection |
Functions | |
template<typename T> | |
T | variant_cast (const Value &v) |
template<typename T> | |
bool | requires_conversion (const Value &v) |
template<typename T> | |
T * | extract_raw_data (Value &v) |
template<typename T> | |
const T * | extract_raw_data (const Value &v) |
|
Returns a typed pointer to the data contained in a const Value instance. If the value's type is not identical to type T, a null pointer is returned. |
|
Returns a typed pointer to the data contained in a Value instance. If the value's type is not identical to type T, a null pointer is returned. |
|
Returns true if the Value passed as parameter can't be casted to the specified type without a (potentially slow) conversion. Returns false otherwise. |
|
Tries to convert an instance of Value to an object of type T. If T is a plain type or a pointer type (either const or non-const), and it matches the type of the value contained in v, then the actual value of type T is returned. If T is a [const] reference type, and its base (non reference) type matches the internal value's type, then a [const] reference to the internal value is returned. If none of the above conditions are met, a conversion is attempted as described in Value::convert() and then variant_cast is called again with the converted value as parameter. If the conversion can't be completed, an exception is thrown. Conversions that attempt to make a const pointer non-const will fail. |