tRecordingBlockBase Class Reference

a block of data to record (for more advanced data storage ), base class More...

#include <tRecorder.h>

Inheritance diagram for tRecordingBlockBase:

Inheritance graph
[legend]
Collaboration diagram for tRecordingBlockBase:

Collaboration graph
[legend]

List of all members.

Public Member Functions

bool Initialize (char const *section, tRecording *recording)
 initializes this for recording
bool Initialize (char const *section)
 initializes this for recording
void Separator ()
 separates two recorded elements (more than usual)

Static Public Member Functions

static tRecordingGetArchive ()
 returns the active recording

Protected Member Functions

 tRecordingBlockBase ()
 default constructor
 ~tRecordingBlockBase ()
 ends a recording block
std::ostream & GetRecordingStream () const
 returns the stream to record to

Protected Attributes

bool separate_
 flag indicating whether a separation is needed before the next data element

Private Attributes

tRecordingrecording_
 the recording to record to


Detailed Description

a block of data to record (for more advanced data storage ), base class

Definition at line 258 of file tRecorder.h.


Constructor & Destructor Documentation

tRecordingBlockBase::tRecordingBlockBase ( void   )  [protected]

default constructor

Definition at line 330 of file tRecorder.cpp.

00331         : separate_( true ), recording_( NULL )
00332 {
00333 }

tRecordingBlockBase::~tRecordingBlockBase ( void   )  [protected]

ends a recording block

Definition at line 344 of file tRecorder.cpp.

References GetRecordingStream(), and recording_.

00345 {
00346     // make sure everything is logged, even if program crashes
00347     if (recording_)
00348         GetRecordingStream().flush();
00349 
00350     recording_ = 0;
00351 }

Here is the call graph for this function:


Member Function Documentation

bool tRecordingBlockBase::Initialize ( char const *  section,
tRecording recording 
)

initializes this for recording

Parameters:
section name of the section to start
recording recording to read block from
Returns:
true on success

Definition at line 260 of file tRecorder.cpp.

References tRecording::BeginSection(), and recording_.

Referenced by Initialize().

00261 {
00262     // initialize recording pointer
00263     recording_ = recording;
00264     if (!recording_)
00265         return false;
00266 
00267     // start section
00268     recording_->BeginSection( section );
00269 
00270     // return success
00271     return true;
00272 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool tRecordingBlockBase::Initialize ( char const *  section  ) 

initializes this for recording

Parameters:
section name of the section to start
Returns:
true on success

Definition at line 285 of file tRecorder.cpp.

References tRecording::currentRecording_, and Initialize().

00286 {
00287     // delegate
00288     return Initialize( section, tRecording::currentRecording_ );
00289 }

Here is the call graph for this function:

void tRecordingBlockBase::Separator ( void   ) 

separates two recorded elements (more than usual)

Definition at line 300 of file tRecorder.cpp.

References GetRecordingStream(), and separate_.

00301 {
00302     GetRecordingStream() << "\n";
00303     separate_ = false;
00304 }

Here is the call graph for this function:

tRecording * tRecordingBlockBase::GetArchive ( void   )  [static]

returns the active recording

Returns:
the currently running recording

Definition at line 316 of file tRecorder.cpp.

References tRecording::currentRecording_.

Referenced by tRecorderBase::IsRecording().

00317 {
00318     return tRecording::currentRecording_;
00319 }

Here is the caller graph for this function:

std::ostream & tRecordingBlockBase::GetRecordingStream (  )  const [protected]

returns the stream to record to

Returns:
the stream of the recording

Definition at line 363 of file tRecorder.cpp.

References tRecording::DoGetStream(), recording_, and tASSERT.

Referenced by Separator(), tRecordingBlock::Write(), and ~tRecordingBlockBase().

00364 {
00365     tASSERT( recording_ );
00366 
00367     return recording_->DoGetStream();
00368 }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

bool tRecordingBlockBase::separate_ [protected]

flag indicating whether a separation is needed before the next data element

Definition at line 272 of file tRecorder.h.

Referenced by Separator(), and tRecordingBlock::Write().

tRecording* tRecordingBlockBase::recording_ [private]

the recording to record to

Definition at line 274 of file tRecorder.h.

Referenced by GetRecordingStream(), Initialize(), and ~tRecordingBlockBase().


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