The class template for typed subclasses of Value.
More...
#include <Value.h>
|
| TypedValue (const T &value) |
|
ValuePtr | copy () const override |
| Create a deep copy of the value. More...
|
|
void | setData (const T &value) |
| Set stored data object.
|
|
void | setData (const TypedValue< T > &value) |
| Set stored data object.
|
|
const T & | getData () const |
| Return stored data object.
|
|
const string & | getTypeString () const override |
| Return type string. More...
|
|
string | getValueString () const override |
| Return value string. More...
|
|
virtual ValuePtr | copy () const =0 |
| Create a deep copy of the value. More...
|
|
template<class T > |
bool | isA () const |
| Return true if this value is of the given type.
|
|
template<class T > |
const T & | asA () const |
| Return our underlying data as an object of the given type. More...
|
|
|
static ValuePtr | createFromString (const string &value) |
| Create a new value of this type from a value string. More...
|
|
template<class T > |
static ValuePtr | createValue (const T &data) |
| Create a new value from an object of any valid MaterialX type.
|
|
static ValuePtr | createValue (const char *data) |
|
static ValuePtr | createValueFromStrings (const string &value, const string &type) |
| Create a new value instance from value and type strings. More...
|
|
static void | setFloatFormat (FloatFormat format) |
| Set float formatting for converting values to strings. More...
|
|
static void | setFloatPrecision (int precision) |
| Set float precision for converting values to strings.
|
|
static FloatFormat | getFloatFormat () |
| Return the current float format.
|
|
static int | getFloatPrecision () |
| Return the current float precision.
|
|
|
enum | FloatFormat { FloatFormatDefault = 0
, FloatFormatFixed = 1
, FloatFormatScientific = 2
} |
| Float formats to use when converting values to strings.
|
|
using | CreatorFunction = ValuePtr(*)(const string &) |
|
using | CreatorMap = std::unordered_map< string, CreatorFunction > |
|
template<class T>
class TypedValue< T >
The class template for typed subclasses of Value.
◆ copy()
Create a deep copy of the value.
Implements Value.
◆ createFromString()
static ValuePtr createFromString |
( |
const string & |
value | ) |
|
|
static |
Create a new value of this type from a value string.
- Returns
- A shared pointer to a typed value, or an empty shared pointer if the conversion to the given data type cannot be performed.
◆ getTypeString()
const string & getTypeString |
( |
| ) |
const |
|
overridevirtual |
Return type string.
Implements Value.
◆ getValueString()
string getValueString |
( |
| ) |
const |
|
overridevirtual |
Return value string.
Implements Value.
The documentation for this class was generated from the following file: