Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

SH::ShVariant Class Reference

An ShVariant is a wrapper around a fixed-size array of data of a data type. More...

#include <ShVariant.hpp>

Inheritance diagram for SH::ShVariant:

Inheritance graph
[legend]
Collaboration diagram for SH::ShVariant:

Collaboration graph
[legend]
List of all members.

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< ShVariantget () const =0
 Creates a copy of this ShVariant.
virtual ShPointer< ShVariantget (int index) const =0
 Creates single element ShVariant with the indexed element from this.
virtual ShPointer< ShVariantget (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

Detailed Description

An ShVariant is a wrapper around a fixed-size array of data of a data type.

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.

See also:
ShDataVariant

Definition at line 52 of file ShVariant.hpp.


Member Function Documentation

virtual std::string SH::ShVariant::encodeArray  )  const [pure virtual]
 

C++ array declaration compatible encoding.

Generates a string that can be used as an array initializer i.e. T foo[size] = { encodeArray() };

Todo:
type may want to put this somewhere else, it doesn't really belong

virtual void SH::ShVariant::set ShPointer< const ShVariant other,
bool  neg,
const ShSwizzle writemask
[pure virtual]
 

Sets the value of this from other using the given negation and writemask on this.

other.size() must equal writemask.size()

virtual void SH::ShVariant::set ShPointer< const ShVariant other  )  [pure virtual]
 

Sets the values of this from other.

size() must equal other.size()


The documentation for this class was generated from the following files:
Generated on Mon Jan 24 18:38:27 2005 for Sh by  doxygen 1.4.1