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

SH::ShGeneric< N, T > Class Template Reference

A variable of length N. More...

#include <ShGeneric.hpp>

Inheritance diagram for SH::ShGeneric< N, T >:

Inheritance graph
[legend]
Collaboration diagram for SH::ShGeneric< N, T >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef T storage_type
typedef ShHostType< T >::type host_type
typedef ShMemType< T >::type mem_type
typedef ShDataVariant< T,
SH_HOST > 
VariantType
typedef ShPointer< VariantType > VariantTypePtr
typedef ShPointer< const VariantType > VariantTypeCPtr

Public Member Functions

 ShGeneric (const ShVariableNodePtr &node, ShSwizzle swizzle, bool neg)
ShGenericoperator= (const ShGeneric &other)
template<typename T2>
ShGenericoperator= (const ShGeneric< N, T2 > &other)
ShGenericoperator= (const ShProgram &other)
template<typename T2>
ShGenericoperator+= (const ShGeneric< N, T2 > &right)
template<typename T2>
ShGenericoperator-= (const ShGeneric< N, T2 > &right)
template<typename T2>
ShGenericoperator *= (const ShGeneric< N, T2 > &right)
template<typename T2>
ShGenericoperator/= (const ShGeneric< N, T2 > &right)
template<typename T2>
ShGenericoperator%= (const ShGeneric< N, T2 > &right)
template<typename T2>
ShGenericoperator+= (const ShGeneric< 1, T2 > &right)
template<typename T2>
ShGenericoperator-= (const ShGeneric< 1, T2 > &right)
template<typename T2>
ShGenericoperator *= (const ShGeneric< 1, T2 > &right)
template<typename T2>
ShGenericoperator/= (const ShGeneric< 1, T2 > &right)
template<typename T2>
ShGenericoperator%= (const ShGeneric< 1, T2 > &right)
ShGenericoperator+= (host_type)
ShGenericoperator-= (host_type)
ShGenericoperator *= (host_type)
ShGenericoperator/= (host_type)
ShGenericoperator%= (host_type)
ShGeneric operator- () const
ShGeneric operator() () const
 Identity swizzle.
ShGeneric< 1, T > operator() (int) const
ShGeneric< 1, T > operator[] (int) const
ShGeneric< 2, T > operator() (int, int) const
ShGeneric< 3, T > operator() (int, int, int) const
ShGeneric< 4, T > operator() (int, int, int, int) const
void range (host_type low, host_type high)
 Range Metadata.
VariantType lowBound () const
host_type lowBound (int index) const
VariantType highBound () const
host_type highBound (int index) const
template<int N2>
ShGeneric< N2, T > swiz (int indices[]) const
void getValues (host_type dest[]) const
 Get the values of this variable, with swizzling taken into account.
host_type getValue (int index) const
void setValue (int index, const host_type &value)
 Set the values of this variable, using the swizzle as a writemask.
void setValues (const host_type values[])
template<typename T2>
 ShGeneric (const ShGeneric< N, T2 > &other)

Static Public Attributes

static const ShValueType value_type
static const int typesize

Protected Member Functions

 ShGeneric (const ShVariableNodePtr &node)

Detailed Description

template<int N, typename T>
class SH::ShGeneric< N, T >

A variable of length N.

This class is provided to make definition of functions that work over n-tuples of particular types easier.

ShAttrib derives from ShGeneric. Unlike ShGeneric, which only has two template parameters, ShAttrib has four template parameters. This would make writing functions quite ugly. E.g.:

Without Generic:

template<int N, typename T, ShBindingType B1, ShBindingType B2, bool S1, bool S2> ShAttrib<N, SH_TEMP, T> add(const ShAttrib<N, B1, T, S1>& a, const ShAttrib<N, B2, T, S2>& b);

With Generic:

template<int N, typename T> ShAttrib<N, SH_TEMP, T> add(const ShGeneric<N, T>& a, const ShGeneric<N, T>& b);

This class is explicitly instantiated for T = float with 1 <= N <= 4.

Definition at line 64 of file ShGeneric.hpp.


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