Menge
Modular Pedestrian Simulation Framework for Research and Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Menge::Agents::SCBWriter Class Reference

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.
 

Detailed Description

Class responsible for writing the agent state of the simulator and fsm into a file.

Constructor & Destructor Documentation

Menge::Agents::SCBWriter::SCBWriter ( const std::string &  pathName,
const std::string &  version,
SimulatorInterface sim 
)

Constructor for SCBWriter.

Parameters
pathNameThe path for the desired output file.
versionA string representing the version to write out.
simA pointer to the simulator to process
Exceptions
SCBVersionExceptionIf the version string is not considered to be a valid version.
SCBFileExceptionIf there is a problem opening the given path for writing.

Member Function Documentation

bool Menge::Agents::SCBWriter::validateVersion ( const std::string &  version)
protected

Confirms that the given version is valid. Function has side-effects. This must be called for the SCBWriter to work.

Parameters
versionA string of the format "major"."minor" (e.g., 2.1) for the desired output format.
Returns
A boolean reporting if the version is valid (true) or invalid (false).
void Menge::Agents::SCBWriter::writeFrame ( BFSM::FSM fsm)

Writes the current frame of the stored simulator to the file.

Parameters
fsmA pointer to the simulator's fsm

The documentation for this class was generated from the following files: