#include <tRecorderInternal.h>
Public Types | |
typedef std::istream | STREAM |
stream typedef | |
Public Member Functions | |
tPlayback () | |
default constructor | |
Protected Member Functions | |
virtual | ~tPlayback () |
destructor | |
void | AdvanceSection () |
begin reading next section | |
Private Member Functions | |
tPlayback (tPlayback const &other) | |
copy constructor | |
tPlayback & | operator= (tPlayback const &other) |
copy operator | |
std::string const & | GetNextSection () const |
name of the next section | |
virtual std::istream & | DoGetStream ()=0 |
returns the stream to read from | |
Private Attributes | |
std::string | nextSection_ |
the name of the next section | |
Static Private Attributes | |
static tPlayback * | currentPlayback_ = 0 |
the currently running playback | |
Friends | |
class | tPlaybackBlockBase |
Definition at line 64 of file tRecorderInternal.h.
typedef std::istream tPlayback::STREAM |
tPlayback::tPlayback | ( | ) |
default constructor
Definition at line 178 of file tRecorderInternal.cpp.
References currentPlayback_, and tASSERT.
00179 { 00180 tASSERT( !currentPlayback_ ); 00181 00182 // set current Playback 00183 currentPlayback_ = this; 00184 }
tPlayback::~tPlayback | ( | ) | [protected, virtual] |
destructor
Definition at line 163 of file tRecorderInternal.cpp.
References currentPlayback_.
00164 { 00165 // clear current Playback 00166 currentPlayback_ = 0; 00167 }
tPlayback::tPlayback | ( | tPlayback const & | other | ) | [private] |
copy constructor
other | the source to copy from |
Definition at line 196 of file tRecorderInternal.cpp.
References tASSERT.
00197 { 00198 tASSERT(false); 00199 }
void tPlayback::AdvanceSection | ( | void | ) | [protected] |
begin reading next section
Definition at line 257 of file tRecorderInternal.cpp.
References con, currentPlayback_, DoGetStream(), nextSection_, and NULL.
Referenced by tPlaybackBlockBase::~tPlaybackBlockBase().
00258 { 00259 std::istream& stream = DoGetStream(); 00260 00261 std::ws( stream ); 00262 stream >> nextSection_; 00263 std::ws( stream ); 00264 00265 // memorize if end marking was seen 00266 static bool end = false; 00267 if ( nextSection_ == "END" ) 00268 end = true; 00269 00270 if ( !stream.good() ) 00271 { 00272 if ( !end ) 00273 con << "Recording ends abruptly here, prepare for a crash!\n"; 00274 00275 // stop playing back 00276 nextSection_ = "EOF"; 00277 currentPlayback_ = NULL; 00278 } 00279 }
copy operator
other | the source to copy from |
Definition at line 212 of file tRecorderInternal.cpp.
References tASSERT.
00213 { 00214 tASSERT(false); 00215 00216 return *this; 00217 }
const std::string & tPlayback::GetNextSection | ( | void | ) | const [private] |
name of the next section
Definition at line 228 of file tRecorderInternal.cpp.
References nextSection_.
Referenced by tPlaybackBlockBase::Initialize().
00229 { 00230 return nextSection_; 00231 }
virtual std::istream& tPlayback::DoGetStream | ( | ) | [private, pure virtual] |
returns the stream to read from
Referenced by AdvanceSection(), and tPlaybackBlockBase::GetPlaybackStream().
friend class tPlaybackBlockBase [friend] |
Definition at line 66 of file tRecorderInternal.h.
std::string tPlayback::nextSection_ [private] |
the name of the next section
Definition at line 84 of file tRecorderInternal.h.
Referenced by AdvanceSection(), and GetNextSection().
tPlayback * tPlayback::currentPlayback_ = 0 [static, private] |
the currently running playback
Definition at line 85 of file tRecorderInternal.h.
Referenced by AdvanceSection(), tPlaybackBlockBase::GetArchive(), tPlaybackBlockBase::Initialize(), tPlayback(), and ~tPlayback().