#include <ShVariant.hpp>
Inheritance diagram for SH::ShVariant:
Public Member Functions | |
virtual ShValueType | valueType () const =0 |
Gives the associated type identifier string mapped to a unique integer index (Note this is here only for convenience and the value is cached somewhere better like in the ShVariableNode). | |
virtual ShDataType | dataType () const =0 |
Gives the data type held by this variant. | |
virtual bool | typeMatches (ShValueType valueType, ShDataType dataType) const =0 |
Returns whether the value/data type in this variant match the given ones. | |
virtual const char * | typeName () const =0 |
virtual int | size () const =0 |
Gives the number of elements stored in this data array. | |
virtual int | datasize () const =0 |
Gives the number of bytes per element stored in this data array. | |
virtual bool | managed () const =0 |
Returns true if the array held in the ShVariant was allocated by this. | |
virtual void | negate ()=0 |
The only two required operations on data values - negation and copy assignment. | |
virtual void | set (ShPointer< const ShVariant > other)=0 |
Sets the values of this from other. | |
virtual void | set (const ShVariant *other)=0 |
virtual void | set (ShPointer< const ShVariant > other, int index)=0 |
Sets the value of the indexed element in this from the first element of other. | |
virtual void | set (const ShVariant *other, int index)=0 |
virtual void | set (ShPointer< const ShVariant > other, bool neg, const ShSwizzle &writemask)=0 |
Sets the value of this from other using the given negation and writemask on this. | |
virtual void | set (const ShVariant *other, bool neg, const ShSwizzle &writemask)=0 |
virtual ShPointer< ShVariant > | get () const =0 |
Creates a copy of this ShVariant. | |
virtual ShPointer< ShVariant > | get (int index) const =0 |
Creates single element ShVariant with the indexed element from this. | |
virtual ShPointer< ShVariant > | get (bool neg, const ShSwizzle &swizzle) const =0 |
Creates a copy of the Variant with the given swizzle and negation swizzle.m_srcSize must equal size(). | |
virtual bool | isTrue () const =0 |
Returns whether every tuple element is positive. | |
virtual std::string | encode () const =0 |
Encodes the data value as a string. | |
virtual std::string | encode (int index, int repeats=1) const =0 |
virtual std::string | encode (bool neg, const ShSwizzle &swizzle) const =0 |
virtual std::string | encodeArray () const =0 |
C++ array declaration compatible encoding. | |
virtual bool | equals (ShPointer< const ShVariant > other) const =0 |
virtual bool | equals (const ShVariant *other) const =0 |
virtual void * | array ()=0 |
virtual const void * | array () const =0 |
It is used internally for holding tuple data for ShVariableNodes, and occasionally as temporaries for larger data arrays.
There are ShDataVariant<V> implementations that hold a T array.
Definition at line 52 of file ShVariant.hpp.
|
C++ array declaration compatible encoding. Generates a string that can be used as an array initializer i.e. T foo[size] = { encodeArray() };
|
|
Sets the value of this from other using the given negation and writemask on this. other.size() must equal writemask.size() |
|
Sets the values of this from other. size() must equal other.size() |