Writer and ParallelWriter are the superclasses for all output formats. More...
#include <writer.h>
Inherited by LibGeoDecomp::Clonable< Writer< CELL_TYPE >, ASCIIWriter< CELL_TYPE, ATTRIBUTE_SELECTOR > >, LibGeoDecomp::Clonable< Writer< CELL_TYPE >, MemoryWriter< CELL_TYPE > >, LibGeoDecomp::Clonable< Writer< CELL_TYPE >, MPIIOWriter< CELL_TYPE > >, LibGeoDecomp::Clonable< Writer< CELL_TYPE >, PPMWriter< CELL_TYPE, CELL_PLOTTER > >, LibGeoDecomp::Clonable< Writer< CELL_TYPE >, SerialBOVWriter< CELL_TYPE > >, and LibGeoDecomp::Clonable< Writer< CELL_TYPE >, TracingWriter< CELL_TYPE > >.
Public Types | |
typedef MonolithicSimulator < CELL_TYPE >::GridType | GridType |
typedef APITraits::SelectTopology < CELL_TYPE >::Value | Topology |
Public Member Functions | |
Writer (const std::string &prefix, const unsigned period) | |
initializes a writer using prefix which subclasses may use to generate filenames. | |
virtual | ~Writer () |
virtual Writer * | clone () const =0 |
"virtual copy constructor". | |
virtual void | stepFinished (const GridType &grid, unsigned step, WriterEvent event)=0 |
is called back from sim after each simulation step. | |
const unsigned & | getPeriod () const |
const std::string & | getPrefix () const |
Static Public Attributes | |
static const int | DIM = Topology::DIM |
static const unsigned | NANO_STEPS = APITraits::SelectNanoSteps<CELL_TYPE>::VALUE |
Protected Attributes | |
std::string | prefix |
unsigned | period |
Friends | |
class | Serialization |
class | WriterTest |
Writer and ParallelWriter are the superclasses for all output formats.
Writer is for use with MonolithicSimulator and its heirs. It defines three callbacks which are invoked by the simulator. The prefix may be used by file-based IO objects to generate file names. Usually one will add a time step number and a suitable extension.
typedef MonolithicSimulator<CELL_TYPE>::GridType LibGeoDecomp::Writer< CELL_TYPE >::GridType |
typedef APITraits::SelectTopology<CELL_TYPE>::Value LibGeoDecomp::Writer< CELL_TYPE >::Topology |
LibGeoDecomp::Writer< CELL_TYPE >::Writer | ( | const std::string & | prefix, | |
const unsigned | period | |||
) | [inline] |
initializes a writer using prefix which subclasses may use to generate filenames.
period should be used by them to control how many time steps lie between outputs. The Writer will register at sim which in turn will delete the Writer. Thus a writer should always be constructed via new(), unless sim is 0.
virtual LibGeoDecomp::Writer< CELL_TYPE >::~Writer | ( | ) | [inline, virtual] |
virtual Writer* LibGeoDecomp::Writer< CELL_TYPE >::clone | ( | ) | const [pure virtual] |
"virtual copy constructor".
This function may be called whenever a deep copy of a Writer is needed instead of a plain pointer copy.
Advice to implementers: use CRTP ( http://en.wikipedia.org/wiki/Curiously_recurring_template_pattern ) to implement this automagically -- see other Writer implementations for advice on this subject.
Implemented in LibGeoDecomp::Clonable< Writer< CELL_TYPE >, ASCIIWriter< CELL_TYPE, ATTRIBUTE_SELECTOR > >, LibGeoDecomp::Clonable< Writer< CELL_TYPE >, MPIIOWriter< CELL_TYPE > >, LibGeoDecomp::Clonable< Writer< CELL_TYPE >, PPMWriter< CELL_TYPE, CELL_PLOTTER > >, LibGeoDecomp::Clonable< Writer< CELL_TYPE >, TracingWriter< CELL_TYPE > >, LibGeoDecomp::Clonable< Writer< TestCell< 2 > >, MockWriter >, LibGeoDecomp::Clonable< Writer< CELL_TYPE >, SerialBOVWriter< CELL_TYPE > >, LibGeoDecomp::Clonable< Writer< TestCell< 2 > >, TestWriter >, and LibGeoDecomp::Clonable< Writer< CELL_TYPE >, MemoryWriter< CELL_TYPE > >.
Referenced by LibGeoDecomp::SimulationFactory< CELL >::operator()().
const unsigned& LibGeoDecomp::Writer< CELL_TYPE >::getPeriod | ( | ) | const [inline] |
const std::string& LibGeoDecomp::Writer< CELL_TYPE >::getPrefix | ( | ) | const [inline] |
virtual void LibGeoDecomp::Writer< CELL_TYPE >::stepFinished | ( | const GridType & | grid, | |
unsigned | step, | |||
WriterEvent | event | |||
) | [pure virtual] |
is called back from sim after each simulation step.
event specifies the phase in which the simulation is currently in. This may be used for instance to open/close files at the beginning/end of the simulation.
Implemented in LibGeoDecomp::ASCIIWriter< CELL_TYPE, ATTRIBUTE_SELECTOR >, LibGeoDecomp::MemoryWriter< CELL_TYPE >, LibGeoDecomp::MPIIOWriter< CELL_TYPE >, LibGeoDecomp::PPMWriter< CELL_TYPE, CELL_PLOTTER >, and LibGeoDecomp::SerialBOVWriter< CELL_TYPE >.
Referenced by LibGeoDecomp::CollectingWriter< CELL_TYPE >::stepFinished().
friend class Serialization [friend] |
Reimplemented in LibGeoDecomp::SerialBOVWriter< CELL_TYPE >, LibGeoDecomp::Clonable< Writer< CELL_TYPE >, ASCIIWriter< CELL_TYPE, ATTRIBUTE_SELECTOR > >, LibGeoDecomp::Clonable< Writer< CELL_TYPE >, MPIIOWriter< CELL_TYPE > >, LibGeoDecomp::Clonable< Writer< CELL_TYPE >, PPMWriter< CELL_TYPE, CELL_PLOTTER > >, LibGeoDecomp::Clonable< Writer< CELL_TYPE >, TracingWriter< CELL_TYPE > >, LibGeoDecomp::Clonable< Writer< TestCell< 2 > >, MockWriter >, LibGeoDecomp::Clonable< Writer< CELL_TYPE >, SerialBOVWriter< CELL_TYPE > >, LibGeoDecomp::Clonable< Writer< TestCell< 2 > >, TestWriter >, and LibGeoDecomp::Clonable< Writer< CELL_TYPE >, MemoryWriter< CELL_TYPE > >.
friend class WriterTest [friend] |
const int LibGeoDecomp::Writer< CELL_TYPE >::DIM = Topology::DIM [static] |
const unsigned LibGeoDecomp::Writer< CELL_TYPE >::NANO_STEPS = APITraits::SelectNanoSteps<CELL_TYPE>::VALUE [static] |
unsigned LibGeoDecomp::Writer< CELL_TYPE >::period [protected] |
std::string LibGeoDecomp::Writer< CELL_TYPE >::prefix [protected] |