Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes

LibGeoDecomp::ClonableInitializerWrapper< INITIALIZER > Class Template Reference

This class adds a default clone() to any Initializer via its copy c-tor. More...

#include <clonableinitializerwrapper.h>

Inherits ClonableInitializer< INITIALIZER::Cell >.

Collaboration diagram for LibGeoDecomp::ClonableInitializerWrapper< INITIALIZER >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef INITIALIZER::Cell Cell
typedef INITIALIZER::Topology Topology

Public Member Functions

 ClonableInitializerWrapper (const INITIALIZER &initializer)
virtual void grid (GridBase< Cell, DIM > *target)
virtual CoordBox< DIMgridBox ()
 Allows a Simulator to discover the extent of the whole simulation.
virtual Coord< DIMgridDimensions () const
 returns the size of the gridBox().
virtual unsigned startStep () const
 yields the logical time step at which the simulation should start
virtual unsigned maxSteps () const
 gives the time step at which the simulation should terminate.
virtual ClonableInitializer
< Cell > * 
clone () const
 "virtual copy constructor".

Static Public Member Functions

static ClonableInitializer
< Cell > * 
wrap (const INITIALIZER &initializer)

Static Public Attributes

static const int DIM = Topology::DIM

Private Attributes

INITIALIZER delegate

Detailed Description

template<class INITIALIZER>
class LibGeoDecomp::ClonableInitializerWrapper< INITIALIZER >

This class adds a default clone() to any Initializer via its copy c-tor.

This is primarily a convenience for users who are this way not forced to inherit from Clonable.


Member Typedef Documentation

template<class INITIALIZER >
typedef INITIALIZER::Cell LibGeoDecomp::ClonableInitializerWrapper< INITIALIZER >::Cell
template<class INITIALIZER >
typedef INITIALIZER::Topology LibGeoDecomp::ClonableInitializerWrapper< INITIALIZER >::Topology

Constructor & Destructor Documentation

template<class INITIALIZER >
LibGeoDecomp::ClonableInitializerWrapper< INITIALIZER >::ClonableInitializerWrapper ( const INITIALIZER &  initializer  )  [inline]

Member Function Documentation

template<class INITIALIZER >
virtual ClonableInitializer<Cell>* LibGeoDecomp::ClonableInitializerWrapper< INITIALIZER >::clone (  )  const [inline, virtual]

"virtual copy constructor".

This function may be called whenever a deep copy of an Initializer 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 Initializer implementations for advice on this subject.

Implements LibGeoDecomp::ClonableInitializer< INITIALIZER::Cell >.

template<class INITIALIZER >
virtual void LibGeoDecomp::ClonableInitializerWrapper< INITIALIZER >::grid ( GridBase< Cell, DIM > *  target  )  [inline, virtual]
template<class INITIALIZER >
virtual CoordBox<DIM> LibGeoDecomp::ClonableInitializerWrapper< INITIALIZER >::gridBox (  )  [inline, virtual]

Allows a Simulator to discover the extent of the whole simulation.

Usually Simulations will use 0 as the origin, but there is no oblication to do so.

Reimplemented from LibGeoDecomp::Initializer< INITIALIZER::Cell >.

template<class INITIALIZER >
virtual Coord<DIM> LibGeoDecomp::ClonableInitializerWrapper< INITIALIZER >::gridDimensions (  )  const [inline, virtual]

returns the size of the gridBox().

Implements LibGeoDecomp::Initializer< INITIALIZER::Cell >.

template<class INITIALIZER >
virtual unsigned LibGeoDecomp::ClonableInitializerWrapper< INITIALIZER >::maxSteps (  )  const [inline, virtual]

gives the time step at which the simulation should terminate.

Example: if startStep is 0 and maxSteps is 10, then the Simulator should start at t=0, update to t=1, update to t=2, ... until it has updated to t=10.

If startStep is 5 and maxSteps is 8, then the Simulator is expected to init at t=5, update to t=6, update to t=7, and finally update to t=8.

Implements LibGeoDecomp::Initializer< INITIALIZER::Cell >.

template<class INITIALIZER >
virtual unsigned LibGeoDecomp::ClonableInitializerWrapper< INITIALIZER >::startStep (  )  const [inline, virtual]

yields the logical time step at which the simulation should start

Implements LibGeoDecomp::Initializer< INITIALIZER::Cell >.

template<class INITIALIZER >
static ClonableInitializer<Cell>* LibGeoDecomp::ClonableInitializerWrapper< INITIALIZER >::wrap ( const INITIALIZER &  initializer  )  [inline, static]

Member Data Documentation

template<class INITIALIZER >
INITIALIZER LibGeoDecomp::ClonableInitializerWrapper< INITIALIZER >::delegate [private]
template<class INITIALIZER >
const int LibGeoDecomp::ClonableInitializerWrapper< INITIALIZER >::DIM = Topology::DIM [static]

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