Menge
Modular Pedestrian Simulation Framework for Research and Development
|
Class responsible for writing the agent state of the simulator and fsm into a file. More...
#include <SCBWriter.h>
Public Member Functions | |
SCBWriter (const std::string &pathName, const std::string &version, SimulatorInterface *sim) | |
Constructor for SCBWriter. More... | |
~SCBWriter () | |
Destructor. | |
void | writeFrame (BFSM::FSM *fsm) |
Writes the current frame of the stored simulator to the file. More... | |
Protected Member Functions | |
bool | validateVersion (const std::string &version) |
Confirms that the given version is valid. Function has side-effects. This must be called for the SCBWriter to work. More... | |
void | writeHeader () |
Writes the appropriate header to the open file. | |
void | writeHeader1_0 () |
Writes the header appropriate to major version 1 formats. | |
void | writeHeader2_0 () |
Writes the header appropriate to major version 2 formats. | |
Protected Attributes | |
SCBFrameWriter * | _frameWriter |
The frame writer – defines the format of the frame's data. | |
int | _version [2] |
The version of the scb file to be written. Version is represented by the integer _verstion[0]._version[1]. | |
SimulatorInterface * | _sim |
A pointer to the simulator to write to the file. | |
std::ofstream | _file |
The file object for the scb stream to be written to. | |
Class responsible for writing the agent state of the simulator and fsm into a file.
Menge::Agents::SCBWriter::SCBWriter | ( | const std::string & | pathName, |
const std::string & | version, | ||
SimulatorInterface * | sim | ||
) |
Constructor for SCBWriter.
pathName | The path for the desired output file. |
version | A string representing the version to write out. |
sim | A pointer to the simulator to process |
SCBVersionException | If the version string is not considered to be a valid version. |
SCBFileException | If there is a problem opening the given path for writing. |
|
protected |
Confirms that the given version is valid. Function has side-effects. This must be called for the SCBWriter to work.
version | A string of the format "major"."minor" (e.g., 2.1) for the desired output format. |
void Menge::Agents::SCBWriter::writeFrame | ( | BFSM::FSM * | fsm | ) |
Writes the current frame of the stored simulator to the file.
fsm | A pointer to the simulator's fsm |