Public Types | Public Member Functions | Static Public Attributes | Protected Attributes | Friends

LibGeoDecomp::Writer< CELL_TYPE > Class Template Reference

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 > >.

Collaboration diagram for LibGeoDecomp::Writer< CELL_TYPE >:
Collaboration graph

List of all members.

Public Types

typedef MonolithicSimulator
< CELL_TYPE >::GridType 
< CELL_TYPE >::Value 

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 Writerclone () 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 unsignedgetPeriod () 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


class Serialization
class WriterTest

Detailed Description

template<typename CELL_TYPE>
class LibGeoDecomp::Writer< CELL_TYPE >

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.

Member Typedef Documentation

template<typename CELL_TYPE>
typedef MonolithicSimulator<CELL_TYPE>::GridType LibGeoDecomp::Writer< CELL_TYPE >::GridType
template<typename CELL_TYPE>
typedef APITraits::SelectTopology<CELL_TYPE>::Value LibGeoDecomp::Writer< CELL_TYPE >::Topology

Constructor & Destructor Documentation

template<typename CELL_TYPE>
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.

template<typename CELL_TYPE>
virtual LibGeoDecomp::Writer< CELL_TYPE >::~Writer (  )  [inline, virtual]

Member Function Documentation

template<typename CELL_TYPE>
virtual Writer* LibGeoDecomp::Writer< CELL_TYPE >::clone (  )  const [pure virtual]
template<typename CELL_TYPE>
const unsigned& LibGeoDecomp::Writer< CELL_TYPE >::getPeriod (  )  const [inline]
template<typename CELL_TYPE>
const std::string& LibGeoDecomp::Writer< CELL_TYPE >::getPrefix (  )  const [inline]
template<typename CELL_TYPE>
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().

Friends And Related Function Documentation

template<typename CELL_TYPE>
friend class Serialization [friend]
template<typename CELL_TYPE>
friend class WriterTest [friend]

Member Data Documentation

template<typename CELL_TYPE>
const int LibGeoDecomp::Writer< CELL_TYPE >::DIM = Topology::DIM [static]
template<typename CELL_TYPE>
const unsigned LibGeoDecomp::Writer< CELL_TYPE >::NANO_STEPS = APITraits::SelectNanoSteps<CELL_TYPE>::VALUE [static]
template<typename CELL_TYPE>
unsigned LibGeoDecomp::Writer< CELL_TYPE >::period [protected]
template<typename CELL_TYPE>
std::string LibGeoDecomp::Writer< CELL_TYPE >::prefix [protected]

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