HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TypedValue< T > Class Template Reference

The class template for typed subclasses of Value. More...

#include <Value.h>

+ Inheritance diagram for TypedValue< T >:

Public Member Functions

 TypedValue ()
 
 TypedValue (const T &value)
 
virtual ~TypedValue ()
 
ValuePtr copy () const override
 Create a deep copy of the value. More...
 
void setData (const T &value)
 Set stored data object. More...
 
void setData (const TypedValue< T > &value)
 Set stored data object. More...
 
const TgetData () const
 Return stored data object. More...
 
const stringgetTypeString () const override
 Return type string. More...
 
string getValueString () const override
 Return value string. More...
 
- Public Member Functions inherited from Value
 Value ()
 
virtual ~Value ()
 
template<class T >
bool isA () const
 Return true if this value is of the given type. More...
 
template<class T >
const TasA () const
 

Static Public Member Functions

static ValuePtr createFromString (const string &value)
 
- Static Public Member Functions inherited from Value
template<class T >
static ValuePtr createValue (const T &data)
 Create a new value from an object of any valid MaterialX type. More...
 
static ValuePtr createValue (const char *data)
 
static ValuePtr createValueFromStrings (const string &value, const string &type)
 
static void setFloatFormat (FloatFormat format)
 
static void setFloatPrecision (int precision)
 Set float precision for converting values to strings. More...
 
static FloatFormat getFloatFormat ()
 Return the current float format. More...
 
static int getFloatPrecision ()
 Return the current float precision. More...
 

Static Public Attributes

static const string TYPE
 

Additional Inherited Members

- Public Types inherited from Value
enum  FloatFormat { FloatFormatDefault = 0, FloatFormatFixed = 1, FloatFormatScientific = 2 }
 Float formats to use when converting values to strings. More...
 
- Protected Types inherited from Value
using CreatorFunction = ValuePtr(*)(const string &)
 Return true if this value is of the given type. More...
 
using CreatorMap = std::unordered_map< string, CreatorFunction >
 Return true if this value is of the given type. More...
 

Detailed Description

template<class T>
class TypedValue< T >

The class template for typed subclasses of Value.

Definition at line 33 of file Value.h.

Constructor & Destructor Documentation

template<class T>
TypedValue< T >::TypedValue ( )
inline

Definition at line 140 of file Value.h.

template<class T>
TypedValue< T >::TypedValue ( const T value)
inlineexplicit

Definition at line 144 of file Value.h.

template<class T>
virtual TypedValue< T >::~TypedValue ( )
inlinevirtual

Definition at line 148 of file Value.h.

Member Function Documentation

template<class T>
ValuePtr TypedValue< T >::copy ( ) const
inlineoverridevirtual

Create a deep copy of the value.

Implements Value.

Definition at line 151 of file Value.h.

template<class T>
static ValuePtr TypedValue< T >::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.
template<class T>
const T& TypedValue< T >::getData ( ) const
inline

Return stored data object.

Definition at line 169 of file Value.h.

template<class T>
const string& TypedValue< T >::getTypeString ( ) const
overridevirtual

Return type string.

Implements Value.

template<class T>
string TypedValue< T >::getValueString ( ) const
overridevirtual

Return value string.

Implements Value.

template<class T>
void TypedValue< T >::setData ( const T value)
inline

Set stored data object.

Definition at line 157 of file Value.h.

template<class T>
void TypedValue< T >::setData ( const TypedValue< T > &  value)
inline

Set stored data object.

Definition at line 163 of file Value.h.

Member Data Documentation

template<class T>
const string TypedValue< T >::TYPE
static

Definition at line 190 of file Value.h.


The documentation for this class was generated from the following file: