#include <logstream.h>

Public Member Functions | |
| LogStream (MessageFactory &msgFactory) | |
| Constructs the logging stream. | |
| virtual void | Create (const std::string &logsPath, const std::string &logResourceName)=0 |
| Implementations should create the necessary resources to support log streaming. | |
| virtual void | Close ()=0 |
| Implementations should cleanup any used resources and close the log stream. | |
| virtual void | Open (const std::string &logsPath, const std::string &logResourceName)=0 |
| Opens a log resource for reading. | |
| virtual void | Delete (const std::string &logsPath, const std::string &logResourceName)=0 |
| Deletes the specified log resource. | |
| virtual void | WriteMessage (const Message &msg, double timeStamp)=0 |
| Writes a game message to the stream. | |
| virtual dtCore::RefPtr< Message > | ReadMessage (double &timeStamp)=0 |
| Reads a game message from the current stream. | |
| virtual void | InsertTag (LogTag &newTag)=0 |
| Creates and inserts a new tag into the current log stream. | |
| virtual void | InsertKeyFrame (LogKeyframe &newKeyFrame)=0 |
| Creates and inserts a new keyframe into the current log stream. | |
| virtual void | JumpToKeyFrame (const LogKeyframe &keyFrame)=0 |
| Implementations of this method should adjust the current stream such that the next call to ReadMessage() returns the first message corresponding to the requested keyframe. | |
| virtual void | GetTagIndex (std::vector< LogTag > &tags)=0 |
| Gets the list of tags contained within the log stream. | |
| virtual void | GetKeyFrameIndex (std::vector< LogKeyframe > &keyFrames)=0 |
| Gets the list of keyframes contained within the log stream. | |
| virtual void | GetAvailableLogs (const std::string &logsPath, std::vector< std::string > &logs)=0 |
| Gets a list of the current logs available to the log stream by searching the specified directory. | |
| virtual void | Flush ()=0 |
| This method should flush the stream, thereby writing any cached data the stream might contain. | |
| virtual bool | IsEndOfStream () const |
| |
| virtual double | GetRecordDuration () const |
| Gets the amount of recorded simulation time contained within this log stream. | |
| virtual void | SetRecordDuration (double value) |
| Sets the record duration reflected by this log stream. | |
| MessageFactory & | GetMessageFactory () |
| Gets a reference to this stream's message factory. | |
Protected Member Functions | |
| virtual | ~LogStream () |
| Empty Destructor... | |
Protected Attributes | |
| bool | mEndOfStream |
| bool | mIsOpen |
It can be extended to support any log file format desired. In addition to streaming, this interface supports methods that provide an abstract look at a log thereby allowing any custom log formats to plug in to the existing system.
There may not be a one to one mapping between a LogStream instance and a physical file.
| dtGame::LogStream::LogStream | ( | MessageFactory & | msgFactory | ) | [inline] |
Constructs the logging stream.
| msgFactory | This is the message factory assigned to the log stream. This factory is used to re-create that have been read from the log stream. |
| virtual dtGame::LogStream::~LogStream | ( | ) | [inline, protected, virtual] |
Empty Destructor...
| virtual void dtGame::LogStream::Create | ( | const std::string & | logsPath, | |
| const std::string & | logResourceName | |||
| ) | [pure virtual] |
Implementations should create the necessary resources to support log streaming.
| logResourceName | The base name of the new log resource. Implementations should use this in some form in their naming conventions for log files. |
Implemented in dtGame::BinaryLogStream.
| virtual void dtGame::LogStream::Close | ( | ) | [pure virtual] |
Implementations should cleanup any used resources and close the log stream.
Implemented in dtGame::BinaryLogStream.
| virtual void dtGame::LogStream::Open | ( | const std::string & | logsPath, | |
| const std::string & | logResourceName | |||
| ) | [pure virtual] |
Opens a log resource for reading.
| logResourceName | The base name of the new log resource. Implementations should use this in some form in their naming conventions for log files. |
Implemented in dtGame::BinaryLogStream.
| virtual void dtGame::LogStream::Delete | ( | const std::string & | logsPath, | |
| const std::string & | logResourceName | |||
| ) | [pure virtual] |
Deletes the specified log resource.
| logsPath | The absolute path containing the logs. | |
| logResourceName | The base name of the log resource to destroy. Implementation should use this in some form in their naming conventions for log files. |
Implemented in dtGame::BinaryLogStream.
| virtual void dtGame::LogStream::WriteMessage | ( | const Message & | msg, | |
| double | timeStamp | |||
| ) | [pure virtual] |
Writes a game message to the stream.
| msg | The message to write. | |
| timeStamp | The time stamp matched to this message. |
Implemented in dtGame::BinaryLogStream.
| virtual dtCore::RefPtr<Message> dtGame::LogStream::ReadMessage | ( | double & | timeStamp | ) | [pure virtual] |
Reads a game message from the current stream.
| This | parameter will contain the time stamp of the read message. |
Implemented in dtGame::BinaryLogStream.
| virtual void dtGame::LogStream::InsertTag | ( | LogTag & | newTag | ) | [pure virtual] |
Creates and inserts a new tag into the current log stream.
| newTag | The new tag to insert. |
Implemented in dtGame::BinaryLogStream.
| virtual void dtGame::LogStream::InsertKeyFrame | ( | LogKeyframe & | newKeyFrame | ) | [pure virtual] |
Creates and inserts a new keyframe into the current log stream.
| newKeyFrame | The new keyframe to insert. |
Implemented in dtGame::BinaryLogStream.
| virtual void dtGame::LogStream::JumpToKeyFrame | ( | const LogKeyframe & | keyFrame | ) | [pure virtual] |
Implementations of this method should adjust the current stream such that the next call to ReadMessage() returns the first message corresponding to the requested keyframe.
| keyFrame | The keyframe to go to. |
Implemented in dtGame::BinaryLogStream.
| virtual void dtGame::LogStream::GetTagIndex | ( | std::vector< LogTag > & | tags | ) | [pure virtual] |
Gets the list of tags contained within the log stream.
| tags | This vector is filled with the tags currently in the log stream. |
Implemented in dtGame::BinaryLogStream.
| virtual void dtGame::LogStream::GetKeyFrameIndex | ( | std::vector< LogKeyframe > & | keyFrames | ) | [pure virtual] |
Gets the list of keyframes contained within the log stream.
| keyFrames | This vector is filled with the tags currently in the log stream. |
Implemented in dtGame::BinaryLogStream.
| virtual void dtGame::LogStream::GetAvailableLogs | ( | const std::string & | logsPath, | |
| std::vector< std::string > & | logs | |||
| ) | [pure virtual] |
Gets a list of the current logs available to the log stream by searching the specified directory.
| logsPath | An absolute path to the directory containing the available logs. | |
| logs | Filled with the available logs. |
Implemented in dtGame::BinaryLogStream.
| virtual void dtGame::LogStream::Flush | ( | ) | [pure virtual] |
This method should flush the stream, thereby writing any cached data the stream might contain.
Implemented in dtGame::BinaryLogStream.
| virtual bool dtGame::LogStream::IsEndOfStream | ( | ) | const [inline, virtual] |
| virtual double dtGame::LogStream::GetRecordDuration | ( | ) | const [inline, virtual] |
Gets the amount of recorded simulation time contained within this log stream.
| virtual void dtGame::LogStream::SetRecordDuration | ( | double | value | ) | [inline, virtual] |
Sets the record duration reflected by this log stream.
| value | The record duration. |
| MessageFactory& dtGame::LogStream::GetMessageFactory | ( | ) | [inline] |
Gets a reference to this stream's message factory.
bool dtGame::LogStream::mEndOfStream [protected] |
bool dtGame::LogStream::mIsOpen [protected] |