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

MX_CORE_API TypedValue ()
 
MX_CORE_API TypedValue (const T &value)
 
virtual MX_CORE_API ~TypedValue ()
 
MX_CORE_API ValuePtr copy () const override
 Create a deep copy of the value. More...
 
MX_CORE_API void setData (const T &value)
 Set stored data object. More...
 
MX_CORE_API void setData (const TypedValue< T > &value)
 Set stored data object. More...
 
MX_CORE_API const TgetData () const
 Return stored data object. More...
 
MX_CORE_API const stringgetTypeString () const override
 Return type string. More...
 
MX_CORE_API string getValueString () const override
 Return value string. More...
 
MX_CORE_API bool isEqual (ConstValuePtr other) const override
 Return true if this value is of the given type. 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 MX_CORE_API 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, ConstTypeDefPtr typeDef=nullptr)
 
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 MX_CORE_API 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 42 of file Value.h.

Constructor & Destructor Documentation

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

Definition at line 130 of file Value.h.

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

Definition at line 134 of file Value.h.

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

Definition at line 138 of file Value.h.

Member Function Documentation

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

Create a deep copy of the value.

Implements Value.

Definition at line 141 of file Value.h.

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

Return stored data object.

Definition at line 159 of file Value.h.

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

Return type string.

Implements Value.

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

Return value string.

Implements Value.

template<class T>
MX_CORE_API bool TypedValue< T >::isEqual ( ConstValuePtr  other) const
inlineoverridevirtual

Return true if this value is of the given type.

Implements Value.

Definition at line 171 of file Value.h.

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

Set stored data object.

Definition at line 147 of file Value.h.

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

Set stored data object.

Definition at line 153 of file Value.h.

Member Data Documentation

template<class T>
MX_CORE_API 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: