ShGeneric.hpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00027
#ifndef SHGENERIC_HPP
00028
#define SHGENERIC_HPP
00029
00030
#include "ShVariable.hpp"
00031
00032
namespace SH {
00033
00034
class ShProgram;
00035
00060
template<
int N,
typename T>
00061 class ShGeneric :
public ShVariable
00062 {
00063
public:
00064
ShGeneric(
const ShVariableNodePtr& node,
ShSwizzle swizzle,
bool neg);
00065 ~
ShGeneric();
00066
00067
ShGeneric& operator=(
const ShGeneric& other);
00068
ShGeneric& operator=(
const ShProgram& other);
00069
00070
ShGeneric& operator+=(
const ShGeneric& right);
00071
ShGeneric& operator-=(
const ShGeneric& right);
00072
ShGeneric& operator*=(
const ShGeneric& right);
00073
ShGeneric& operator/=(
const ShGeneric& right);
00074
ShGeneric& operator%=(
const ShGeneric& right);
00075
ShGeneric& operator+=(
const ShGeneric<1, T>& right);
00076
ShGeneric& operator-=(
const ShGeneric<1, T>& right);
00077
ShGeneric& operator*=(
const ShGeneric<1, T>& right);
00078
ShGeneric& operator/=(
const ShGeneric<1, T>& right);
00079
ShGeneric& operator%=(
const ShGeneric<1, T>& right);
00080
ShGeneric& operator+=(T);
00081
ShGeneric& operator-=(T);
00082
ShGeneric& operator*=(T);
00083
ShGeneric& operator/=(T);
00084
ShGeneric& operator%=(T);
00085
00086
ShGeneric operator-()
const;
00087
00088
ShGeneric operator()()
const;
00089
ShGeneric<1, T> operator()(
int)
const;
00090
ShGeneric<1, T> operator[](
int)
const;
00091
ShGeneric<2, T> operator()(
int,
int)
const;
00092
ShGeneric<3, T> operator()(
int,
int,
int)
const;
00093
ShGeneric<4, T> operator()(
int,
int,
int,
int)
const;
00094
00095
00096
template<
int N2>
00097
ShGeneric<N2, T> swiz(
int indices[])
const;
00098
00099
typedef T ValueType;
00100
static const int typesize = N;
00101
00102
protected:
00103
ShGeneric(
const ShVariableNodePtr& node);
00104 };
00105
00106
template<
typename T>
00107
class ShGeneric<1, T> :
public ShVariable
00108 {
00109
public:
00110
ShGeneric(
const ShVariableNodePtr& node,
ShSwizzle swizzle,
bool neg);
00111 ~
ShGeneric();
00112
00113
ShGeneric& operator=(
const ShGeneric& other);
00114
ShGeneric& operator=(T);
00115
ShGeneric& operator=(
const ShProgram& other);
00116
00117
ShGeneric& operator+=(
const ShGeneric& right);
00118
ShGeneric& operator-=(
const ShGeneric& right);
00119
ShGeneric& operator*=(
const ShGeneric& right);
00120
ShGeneric& operator/=(
const ShGeneric& right);
00121
ShGeneric& operator%=(
const ShGeneric& right);
00122
ShGeneric& operator+=(T);
00123
ShGeneric& operator-=(T);
00124
ShGeneric& operator*=(T);
00125
ShGeneric& operator/=(T);
00126
ShGeneric& operator%=(T);
00127
00128
ShGeneric operator-() const;
00129
00130
ShGeneric operator()() const;
00131
ShGeneric<1, T> operator()(
int) const;
00132
ShGeneric<1, T> operator[](
int) const;
00133
ShGeneric<2, T> operator()(
int,
int) const;
00134
ShGeneric<3, T> operator()(
int,
int,
int) const;
00135
ShGeneric<4, T> operator()(
int,
int,
int,
int) const;
00136
00137
00138 template<
int N2>
00139
ShGeneric<N2, T> swiz(
int indices[]) const;
00140
00141 typedef T ValueType;
00142 static const
int typesize = 1;
00143
00144 protected:
00145
ShGeneric(const
ShVariableNodePtr& node);
00146 };
00147
00148 }
00149
00150
00151
00152 #ifndef SH_DO_NOT_INCLUDE_GENERIC_IMPL
00153 #include "ShGenericImpl.hpp"
00154 #endif
00155
00156 #endif
Generated on Mon Oct 18 14:17:39 2004 for Sh by
1.3.7