#include <tPolynomialMarshaler.h>
Public Member Functions | |
tPolynomialMarshaler () | |
Default constructor. | |
tPolynomialMarshaler (std::string str) | |
Parsing constructor. | |
tPolynomialMarshaler (const tPolynomialMarshaler &other) | |
Copy constructor. | |
tPolynomialMarshaler (const tPolynomial< T > &_constant, const tPolynomial< T > &_variant) | |
Constructor from 2 tPolynomial. | |
void | setConstant (REAL value, int index) |
void | setVariant (REAL value, int index) |
void | setConstant (const tPolynomial< T > &tpConstant) |
void | setVariant (const tPolynomial< T > &tpVariant) |
void | parse (std::string str) |
tPolynomial< T > const | marshal (const tPolynomial< T > &other) |
std::string | toString () const |
Protected Member Functions | |
void | parsePart (std::string str, tArray< REAL > &array) |
int | getLenConstant () const |
int | getLenVariant () const |
Protected Attributes | |
tPolynomial< T > | constant |
tPolynomial< T > | variant |
Friends | |
template<typename D> | |
bool | operator== (const tPolynomialMarshaler< D > &left, const tPolynomialMarshaler< D > &right) |
template<typename D> | |
bool | operator!= (const tPolynomialMarshaler< D > &left, const tPolynomialMarshaler< D > &right) |
Definition at line 39 of file tPolynomialMarshaler.h.
tPolynomialMarshaler< T >::tPolynomialMarshaler | ( | ) | [inline] |
tPolynomialMarshaler< T >::tPolynomialMarshaler | ( | std::string | str | ) | [inline] |
Parsing constructor.
Definition at line 125 of file tPolynomialMarshaler.h.
References tPolynomialMarshaler< T >::parse().
tPolynomialMarshaler< T >::tPolynomialMarshaler | ( | const tPolynomialMarshaler< T > & | other | ) | [inline] |
tPolynomialMarshaler< T >::tPolynomialMarshaler | ( | const tPolynomial< T > & | _constant, | |
const tPolynomial< T > & | _variant | |||
) | [inline] |
void tPolynomialMarshaler< T >::setConstant | ( | REAL | value, | |
int | index | |||
) | [inline] |
Definition at line 170 of file tPolynomialMarshaler.h.
References tPolynomialMarshaler< T >::constant.
Referenced by tPolynomialMarshalerTest::setUp().
00171 { 00172 constant[index] = value; 00173 }
void tPolynomialMarshaler< T >::setVariant | ( | REAL | value, | |
int | index | |||
) | [inline] |
Definition at line 176 of file tPolynomialMarshaler.h.
References tPolynomialMarshaler< T >::variant.
Referenced by tPolynomialMarshalerTest::setUp().
00177 { 00178 variant[index] = value; 00179 }
void tPolynomialMarshaler< T >::setConstant | ( | const tPolynomial< T > & | tpConstant | ) | [inline] |
Definition at line 182 of file tPolynomialMarshaler.h.
References tPolynomialMarshaler< T >::constant.
00183 { 00184 constant = tpConstant; 00185 }
void tPolynomialMarshaler< T >::setVariant | ( | const tPolynomial< T > & | tpVariant | ) | [inline] |
Definition at line 188 of file tPolynomialMarshaler.h.
References tPolynomialMarshaler< T >::variant.
00189 { 00190 variant = tpVariant; 00191 }
void tPolynomialMarshaler< T >::parse | ( | std::string | str | ) | [inline] |
Definition at line 152 of file tPolynomialMarshaler.h.
References tPolynomialMarshaler< T >::constant, TPOLYNOMIAL_MARSHALER_DELIMITER, and tPolynomialMarshaler< T >::variant.
Referenced by tPolynomialMarshalerTest::testParsing(), and tPolynomialMarshaler< T >::tPolynomialMarshaler().
00153 { 00154 int bPos; 00155 #define TPOLYNOMIAL_MARSHALER_DELIMITER ':' 00156 00157 if ( (bPos = str.find(TPOLYNOMIAL_MARSHALER_DELIMITER)) != -1) 00158 { 00159 constant.parse(str.substr(0, bPos)); 00160 variant.parse(str.substr(bPos + 1, str.length())); 00161 } 00162 else 00163 { 00164 constant.parse(str); 00165 variant = tPolynomial<T>(0); 00166 } 00167 }
tPolynomial< T > const tPolynomialMarshaler< T >::marshal | ( | const tPolynomial< T > & | other | ) | [inline] |
Definition at line 85 of file tPolynomialMarshaler.h.
References tPolynomialMarshaler< T >::constant, REAL, tPolynomial< T >::setAtSameReferenceVarValue(), and tPolynomialMarshaler< T >::variant.
Referenced by zZoneInfluenceItemRotation::apply(), zMonitorInfluence::apply(), tPolynomialMarshalerTest::testMarshaling(), and tPolynomialMarshalerTest::testMarshalingWithBase().
00086 { 00087 tPolynomial<T> tf(0); 00088 tPolynomial<T> res(0); 00089 00090 tf.setAtSameReferenceVarValue(other); 00091 res.setAtSameReferenceVarValue(other); 00092 00093 tf = variant.substitute(other); 00094 00095 { 00096 REAL tData[] = {0.0, 1.0}; 00097 tPolynomial<T> t(tData, sizeof(tData)/sizeof(tData[0])); 00098 t.setAtSameReferenceVarValue(other); 00099 00100 res = tf * t; 00101 } 00102 00103 // Reset tf for further computation 00104 tf = tPolynomial<T>(0); 00105 tf.setAtSameReferenceVarValue(other); 00106 00107 tf = constant.substitute(other); 00108 00109 res += tf; 00110 00111 return res; 00112 }
std::string tPolynomialMarshaler< T >::toString | ( | ) | const [inline] |
Definition at line 213 of file tPolynomialMarshaler.h.
References tPolynomialMarshaler< T >::constant, and tPolynomialMarshaler< T >::variant.
Referenced by tPolynomialMarshalerTest::testMarshaling().
00214 { 00215 std::ostringstream ostr(""); 00216 00217 ostr << "Constant :" << std::endl; 00218 ostr << constant.toString() ; 00219 00220 ostr << std::endl << "Variant :" << std::endl; 00221 ostr << variant.toString() ; 00222 00223 return ostr.str(); 00224 }
void tPolynomialMarshaler< T >::parsePart | ( | std::string | str, | |
tArray< REAL > & | array | |||
) | [protected] |
int tPolynomialMarshaler< T >::getLenConstant | ( | ) | const [inline, protected] |
int tPolynomialMarshaler< T >::getLenVariant | ( | ) | const [inline, protected] |
bool operator== | ( | const tPolynomialMarshaler< D > & | left, | |
const tPolynomialMarshaler< D > & | right | |||
) | [friend] |
bool operator!= | ( | const tPolynomialMarshaler< D > & | left, | |
const tPolynomialMarshaler< D > & | right | |||
) | [friend] |
tPolynomial<T> tPolynomialMarshaler< T >::constant [protected] |
Definition at line 65 of file tPolynomialMarshaler.h.
Referenced by tPolynomialMarshaler< nMessage >::getLenConstant(), tPolynomialMarshaler< T >::marshal(), operator==(), tPolynomialMarshaler< T >::parse(), tPolynomialMarshaler< T >::setConstant(), and tPolynomialMarshaler< T >::toString().
tPolynomial<T> tPolynomialMarshaler< T >::variant [protected] |
Definition at line 68 of file tPolynomialMarshaler.h.
Referenced by tPolynomialMarshaler< nMessage >::getLenVariant(), tPolynomialMarshaler< T >::marshal(), operator==(), tPolynomialMarshaler< T >::parse(), tPolynomialMarshaler< T >::setVariant(), and tPolynomialMarshaler< T >::toString().