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

Class which doesn't create any file output. To be used only for testing purposes. More...

#include <NullWriter.h>

Inheritance diagram for NullWriter:
FileWriter

Public Member Functions

 NullWriter ()
 Creates an "uninitialized" NullWriter object.
 
 NullWriter (const std::string &)
 Creates a NullWriter object with a useless base name.
 
 NullWriter (const std::string &, const std::string &)
 Creates a NullWriter object with useless base and directory names.
 
virtual ~NullWriter ()
 Destroys the NullWriter object.
 
void writeParticles (const ParticleContainer &particles, int iteration, int total) override
 Logs the type, mass, position, velocity and force of a ParticleContainer.
 
- Public Member Functions inherited from FileWriter
 FileWriter ()
 Creates a new FileWriter with no file initialized.
 
 FileWriter (const std::string &filename)
 Creates a new FileWriter and opens the file with the given name.
 
virtual ~FileWriter ()
 Closes the opened file and destroys the FileWriter object.
 
void openFile (const std::string &filename)
 Opens / creates the file with the given name.
 
void closeFile ()
 Closes the opened file if it exists, otherwise does nothing.
 
void writeFile (const std::string &content, const std::string &filename="", int iteration=-1, int total=-1)
 Overwrites the contents of the file opened in m_file with a given string. On error, the program will terminate.
 

Additional Inherited Members

- Static Public Member Functions inherited from FileWriter
static void initializeFolder (const std::string &dirname)
 (Re)initializes the output directory.
 
- Protected Attributes inherited from FileWriter
std::ofstream m_file
 Output stream containing the file to write contents to.
 

Detailed Description

Class which doesn't create any file output. To be used only for testing purposes.

Constructor & Destructor Documentation

◆ NullWriter() [1/3]

NullWriter::NullWriter ( )

Creates an "uninitialized" NullWriter object.

◆ NullWriter() [2/3]

NullWriter::NullWriter ( const std::string &  )
explicit

Creates a NullWriter object with a useless base name.

◆ NullWriter() [3/3]

NullWriter::NullWriter ( const std::string &  ,
const std::string &   
)

Creates a NullWriter object with useless base and directory names.

◆ ~NullWriter()

virtual NullWriter::~NullWriter ( )
virtual

Destroys the NullWriter object.

Member Function Documentation

◆ writeParticles()

void NullWriter::writeParticles ( const ParticleContainer particles,
int  iteration,
int  total 
)
overridevirtual

Logs the type, mass, position, velocity and force of a ParticleContainer.

For debugging purposes only.

Parameters
particlesThe ParticleContainer.
iterationThe number of the current iteration, used to generate a unique log output.
totalThe total number of iterations, used to display the current percentage.

Implements FileWriter.


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