MaterialX 1.39.2
Loading...
Searching...
No Matches
AggregateValue Class Reference

A subclass for aggregate values with multiple members. More...

#include <Value.h>

Inheritance diagram for AggregateValue:
Value

Public Member Functions

 AggregateValue (const string &typeName)
 
ValuePtr copy () const override
 Create a deep copy of the value.
 
void appendValue (ConstValuePtr valuePtr)
 Append a member value to the aggregate.
 
const vector< ConstValuePtr > & getMembers () const
 
ConstValuePtr getMemberValue (size_t index) const
 Query an indexed member value from the aggregate.
 
const string & getTypeString () const override
 Return type string.
 
string getValueString () const override
 Return value string.
 
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.
 

Static Public Member Functions

static AggregateValuePtr createAggregateValue (const string &typeName)
 Create a new value from an object of any valid MaterialX type.
 
static AggregateValuePtr createAggregateValueFromString (const string &value, const string &type, ConstTypeDefPtr typeDefPtr)
 
- 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.
 
static ValuePtr createValue (const char *data)
 
static ValuePtr createValueFromStrings (const string &value, const string &type, ConstTypeDefPtr typeDef=nullptr)
 Create a new value instance from value and type strings.
 
static void setFloatFormat (FloatFormat format)
 Set float formatting for converting values to strings.
 
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.
 

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.
 
using CreatorFunction = ValuePtr (*)(const string&)
 
using CreatorMap = std::unordered_map<string, CreatorFunction>
 

Detailed Description

A subclass for aggregate values with multiple members.

Member Function Documentation

◆ copy()

ValuePtr copy ( ) const
inlineoverridevirtual

Create a deep copy of the value.

Implements Value.

◆ getTypeString()

const string & getTypeString ( ) const
inlineoverridevirtual

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: