src/tools/tFunction.h File Reference

#include "defs.h"
#include "tError.h"

Include dependency graph for tFunction.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  tFunction
 mathematical function (to be moved into tools sometime, and currently limited to linear functions) More...

Functions

template<typename T>
T & operator<< (T &m, tFunction const &f)
template<typename T>
T & operator>> (T &m, tFunction &f)
 function network message writing operator


Function Documentation

template<typename T>
T & operator<< ( T &  m,
tFunction const &  f 
) [inline]

Parameters:
m message to write to
f function to write
Returns:
reference to message for chaining

Definition at line 194 of file tFunction.h.

References tFunction::GetOffset(), tFunction::GetSlope(), and nMessage::Write().

00195 {
00196     // write ID for compatibility with future extensions
00197     unsigned short ID = 1;
00198     m.Write( ID );
00199 
00200     // write values
00201     m << f.GetOffset();
00202     m << f.GetSlope();
00203 
00204     return m;
00205 }

Here is the call graph for this function:

template<typename T>
T & operator>> ( T &  m,
tFunction f 
) [inline]

function network message writing operator

Parameters:
m message to read from
f function to read to
Returns:
reference to message for chaining

Definition at line 219 of file tFunction.h.

References nMessage::Read(), REAL, tFunction::SetOffset(), tFunction::SetSlope(), and tASSERT.

00220 {
00221     // write ID for compatibility with future extensions
00222     unsigned short ID;
00223     m.Read(ID);
00224     tASSERT( ID == 1 );
00225 
00226     // read values
00227     REAL slope, offset;
00228     m >> offset >> slope;
00229 
00230     // store values
00231     f.SetOffset( offset ).SetSlope( slope );
00232 
00233     return m;
00234 }

Here is the call graph for this function:


Generated on Sat Mar 15 23:11:48 2008 for Armagetron Advanced by  doxygen 1.5.4