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

SH::ShVariable Class Reference

A reference and interface to a generic n-tuple variable. More...

#include <ShVariable.hpp>

Inheritance diagram for SH::ShVariable:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ShVariable (const ShVariableNodePtr &node)
 ShVariable (const ShVariableNodePtr &node, const ShSwizzle &swizzle, bool neg)
ShVariableoperator= (const ShProgram &prg)
bool null () const
 true iff node is a null pointer.

bool uniform () const
 Is this a uniform (non-shader specific) variable?

bool hasValues () const
 Does this variable have constant (host-local) values?

int size () const
 Get the number of elements in this variable, after swizzling.

const ShSwizzleswizzle () const
 Obtain the swizzling (if any) applied to this variable.

const ShVariableNodePtrnode () const
 Obtain the actual node this variable refers to.

bool neg () const
 Return true if this variable is negated.

bool & neg ()
void getValues (ShVariableNode::ValueType dest[]) const
 Get the values of this variable, with swizzling taken into account.

ShVariableNode::ValueType getValue (int index) const
void setValues (ShVariableNode::ValueType values[])
 Set the values of this variable, using the swizzle as a writemask.

void setValue (int index, ShVariableNode::ValueType value)
ShVariable operator() () const
 Identity swizzle.

ShVariable operator() (int) const
ShVariable operator() (int, int) const
ShVariable operator() (int, int, int) const
ShVariable operator() (int, int, int, int) const
ShVariable operator() (int size, int indices[]) const
ShVariable operator- () const
bool operator== (const ShVariable &other) const
bool operator!= (const ShVariable &other) const
void clone (const ShVariable &other)
Metadata
This data is useful for various things, including asset management.

void range (ShVariableNode::ValueType low, ShVariableNode::ValueType high)
 Set a range of values for this variable.

ShVariableNode::ValueType lowBound () const
 Obtain a lower bound on this variable.

ShVariableNode::ValueType highBound () const
 Obtain an upper bound on this variable.


Protected Attributes

ShVariableNodePtr m_node
 The actual variable node we refer to.

ShSwizzle m_swizzle
 Swizzling applied to this variable.

bool m_neg
 True iff this variable is negated.


Friends

SH_DLLEXPORT std::ostream & operator<< (std::ostream &out, const ShVariable &shVariableToPrint)

Detailed Description

A reference and interface to a generic n-tuple variable.

Note: subclasses should not keep any additional data. All data relevant to the node should be stored in m_node. This is due to instances of subclasses of ShVariable being sliced when they get placed in ShStatements.

Definition at line 47 of file ShVariable.hpp.


The documentation for this class was generated from the following files:
Generated on Mon Oct 18 14:17:59 2004 for Sh by doxygen 1.3.7