ProtoMol - an object-oriented component based framework for Molecular Dynamics simulations.

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

ProtoMol::OutputFile Class Reference

#include <OutputFile.h>

Inheritance diagram for ProtoMol::OutputFile:

ProtoMol::Output ProtoMol::Makeable ProtoMol::OutputDiffusion ProtoMol::OutputDihedrals ProtoMol::OutputEnergies ProtoMol::OutputISGProperties ProtoMol::OutputMomentum ProtoMol::OutputPaulTrap ProtoMol::OutputTemperatures List of all members.

Public Member Functions

 OutputFile ()
 OutputFile (const std::string &filename, int freq, int cacheFreq, int cacheSize, Real closeTime)
virtual ~OutputFile ()
virtual void getParameters (std::vector< Parameter > &parameter) const
virtual bool adjustWithDefaultParameters (std::vector< Value > &values, const Configuration *config) const

Protected Member Functions

bool open ()
bool close ()
virtual void doRunCached (int step)=0
virtual void doFlushCache ()

Protected Attributes

std::string myFilename
std::stringstream myBuffer

Private Member Functions

bool reopen ()
bool reclose ()
void flushCache ()
void clearCache ()
virtual void doRun (int step)
virtual void doFinalize (int step)

Private Attributes

int myCacheFreq
int myCount
int myCacheSize
Real myCloseTime
Timer myTimer
std::ofstream myFile

Detailed Description

OutputFile is a base Output class to write and append data (text) to a file. It provides size and frequency based and caching and also whether the file should be closed and opened between two writes. OutputFile implements doRun(), but provides an equivalent, cached method doRunCached(). The cached (buffered) data is written to file if the number of calls of doRun() is at least the cache frequency and also the buffer size is satisfied. The open/close of the file depends on the give time interval between two writes. Furthermore, getParameters() defines the file name, output frequency, cache frequency, cache size, and the minimal close time keyword.


Constructor & Destructor Documentation

ProtoMol::OutputFile::OutputFile  ) 
 

ProtoMol::OutputFile::OutputFile const std::string &  filename,
int  freq,
int  cacheFreq,
int  cacheSize,
Real  closeTime
 

ProtoMol::OutputFile::~OutputFile  )  [virtual]
 


Member Function Documentation

bool ProtoMol::OutputFile::adjustWithDefaultParameters std::vector< Value > &  values,
const Configuration config
const [virtual]
 

Reimplemented from ProtoMol::Makeable.

Reimplemented in ProtoMol::OutputDihedrals, and ProtoMol::OutputPaulTrap.

void ProtoMol::OutputFile::clearCache  )  [private]
 

clear cache (buffer)

bool ProtoMol::OutputFile::close  )  [protected]
 

close file

void ProtoMol::OutputFile::doFinalize int  step  )  [private, virtual]
 

Hook method of finalize, implemented in the concrete class.

Implements ProtoMol::Output.

Reimplemented in ProtoMol::OutputDihedrals.

virtual void ProtoMol::OutputFile::doFlushCache  )  [inline, protected, virtual]
 

optional implemenatation for cache flush

Reimplemented in ProtoMol::OutputPaulTrap.

void ProtoMol::OutputFile::doRun int  step  )  [private, virtual]
 

Hook method of run, implemented in the concrete class.

Implements ProtoMol::Output.

virtual void ProtoMol::OutputFile::doRunCached int  step  )  [protected, pure virtual]
 

new implementation of run method

Implemented in ProtoMol::OutputDiffusion, ProtoMol::OutputDihedrals, ProtoMol::OutputEnergies, ProtoMol::OutputMomentum, ProtoMol::OutputPaulTrap, ProtoMol::OutputTemperatures, and ProtoMol::OutputISGProperties.

void ProtoMol::OutputFile::flushCache  )  [private]
 

flush cache (buffer) to file

void ProtoMol::OutputFile::getParameters std::vector< Parameter > &  parameter  )  const [virtual]
 

retrieve all parameters

Implements ProtoMol::Makeable.

Reimplemented in ProtoMol::OutputDihedrals, ProtoMol::OutputEnergies, ProtoMol::OutputPaulTrap, ProtoMol::OutputTemperatures, and ProtoMol::OutputISGProperties.

bool ProtoMol::OutputFile::open  )  [protected]
 

open and clear file

bool ProtoMol::OutputFile::reclose  )  [private]
 

close file if requested

bool ProtoMol::OutputFile::reopen  )  [private]
 

open file for append


Member Data Documentation

std::stringstream ProtoMol::OutputFile::myBuffer [protected]
 

int ProtoMol::OutputFile::myCacheFreq [private]
 

int ProtoMol::OutputFile::myCacheSize [private]
 

Real ProtoMol::OutputFile::myCloseTime [private]
 

int ProtoMol::OutputFile::myCount [private]
 

std::ofstream ProtoMol::OutputFile::myFile [private]
 

std::string ProtoMol::OutputFile::myFilename [protected]
 

Timer ProtoMol::OutputFile::myTimer [private]
 


The documentation for this class was generated from the following files: Last update: . GNU GENERAL PUBLIC LICENSE, copyrighted by the University of Notre Dame and the University of Bergen, Norway.