MolSim
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
XMLWriter Class Reference

Class used to serialize simulation results to an XML file which can once again be used as input. More...

#include <XMLWriter.h>

Public Member Functions

 XMLWriter (const std::string &filename)
 Constructs a new XMLWriter object.
 
 ~XMLWriter ()
 Destroys the current XMLWriter object.
 
void serialize (const ParticleContainer &pc, const Arguments &args, const Thermostat &t, const FlowSimulationAnalyzer &fsa)
 Serializes simulation data to an XML file.
 

Private Member Functions

void openFile (const std::string &filename)
 Opens a new file for writing.
 
void closeFile ()
 Closes the opened file.
 

Private Attributes

std::ofstream m_file
 Output stream containing the XML file to write contents to.
 
std::string m_filename
 The name of the output file.
 

Detailed Description

Class used to serialize simulation results to an XML file which can once again be used as input.

Constructor & Destructor Documentation

◆ XMLWriter()

XMLWriter::XMLWriter ( const std::string &  filename)
explicit

Constructs a new XMLWriter object.

Parameters
filenameThe name of the file to be written to.

◆ ~XMLWriter()

XMLWriter::~XMLWriter ( )

Destroys the current XMLWriter object.

Member Function Documentation

◆ closeFile()

void XMLWriter::closeFile ( )
private

Closes the opened file.

◆ openFile()

void XMLWriter::openFile ( const std::string &  filename)
private

Opens a new file for writing.

Parameters
filenameThe name of the file to be written to.

◆ serialize()

void XMLWriter::serialize ( const ParticleContainer pc,
const Arguments args,
const Thermostat t,
const FlowSimulationAnalyzer fsa 
)

Serializes simulation data to an XML file.

Parameters
pcThe ParticleContainer containing the active simulation particles.
argsThe Arguments struct containing simulation metadata.
tThe thermostat.
fsaThe analyzer, which may be on or off. If disabled, it will not be serialized.

Member Data Documentation

◆ m_file

std::ofstream XMLWriter::m_file
private

Output stream containing the XML file to write contents to.

◆ m_filename

std::string XMLWriter::m_filename
private

The name of the output file.


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