tRecorderBlockHelper< DATA > Class Template Reference

class taking the ugly implementation part of tRecordingBlock and tPlaybackBlock More...

#include <tRecorder.h>

List of all members.

Static Public Member Functions

static void Write (std::ostream &stream, DATA const &data, int nodummyrequired)
 writes a piece of data using a dummy
static void Write (std::ostream &stream, DATA const &data, int *dummyrequired)
 writes a piece of data using a dummy
static void Read (std::istream &stream, DATA &data, int nodummyrequired)
 reads a piece of data using a dummy
static void Read (std::istream &stream, DATA &data, int *dummyrequired)
 reads a piece of data using a dummy


Detailed Description

template<class DATA>
class tRecorderBlockHelper< DATA >

class taking the ugly implementation part of tRecordingBlock and tPlaybackBlock

Definition at line 241 of file tRecorder.h.


Member Function Documentation

template<class DATA>
void tRecorderBlockHelper< DATA >::Write ( std::ostream &  stream,
DATA const &  data,
int  nodummyrequired 
) [inline, static]

writes a piece of data using a dummy

Parameters:
stream the stream to write to
data the data to archive
nodummyrequired dummy parameter indicating by type that no conversion is required

Definition at line 1086 of file tRecorder.h.

Referenced by tRecordingBlock::Write().

01087 {
01088     // write
01089     stream << data;
01090 }

Here is the caller graph for this function:

template<class DATA>
void tRecorderBlockHelper< DATA >::Write ( std::ostream &  stream,
DATA const &  data,
int *  dummyrequired 
) [inline, static]

writes a piece of data using a dummy

Parameters:
stream the stream to write to
data the data to archive
dummyrequired dummy parameter indicating by type that conversion is required

Definition at line 1105 of file tRecorder.h.

01106 {
01107     // write ( converted )
01108     typedef typename tTypeToStream< DATA >::TOSTREAM TOSTREAM;
01109     TOSTREAM dummy = static_cast< TOSTREAM >( data );
01110     stream << dummy;
01111 }

template<class DATA>
void tRecorderBlockHelper< DATA >::Read ( std::istream &  stream,
DATA &  data,
int  nodummyrequired 
) [inline, static]

reads a piece of data using a dummy

Parameters:
stream the stream to read from
data the data to archive
nodummyrequired dummy parameter indicating by type that no conversion is required

Definition at line 1126 of file tRecorder.h.

References tASSERT.

Referenced by tPlaybackBlock::Read().

01127 {
01128     tASSERT( stream.good() );
01129 
01130     // read
01131     stream >> data;
01132 }

Here is the caller graph for this function:

template<class DATA>
void tRecorderBlockHelper< DATA >::Read ( std::istream &  stream,
DATA &  data,
int *  dummyrequired 
) [inline, static]

reads a piece of data using a dummy

Parameters:
stream the stream to read from
data the data to archive
dummyrequired dummy parameter indicating by type that conversion is required

Definition at line 1147 of file tRecorder.h.

References tASSERT.

01148 {
01149     tASSERT( stream.good() );
01150 
01151     // read ( with conversion )
01152     typedef typename tTypeToStream< DATA >::TOSTREAM TOSTREAM;
01153     TOSTREAM dummy ;
01154     stream >> dummy;
01155     data = static_cast< DATA >( dummy );
01156 }


The documentation for this class was generated from the following file:
Generated on Sat Mar 15 23:58:38 2008 for Armagetron Advanced by  doxygen 1.5.4