This class adds a default clone() to any Initializer via its copy c-tor. More...
#include <clonableinitializerwrapper.h>
Inherits ClonableInitializer< INITIALIZER::Cell >.
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< DIM > | gridBox () |
Allows a Simulator to discover the extent of the whole simulation. | |
virtual Coord< DIM > | gridDimensions () 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 |
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.
typedef INITIALIZER::Cell LibGeoDecomp::ClonableInitializerWrapper< INITIALIZER >::Cell |
Reimplemented from LibGeoDecomp::Initializer< INITIALIZER::Cell >.
typedef INITIALIZER::Topology LibGeoDecomp::ClonableInitializerWrapper< INITIALIZER >::Topology |
Reimplemented from LibGeoDecomp::Initializer< INITIALIZER::Cell >.
LibGeoDecomp::ClonableInitializerWrapper< INITIALIZER >::ClonableInitializerWrapper | ( | const INITIALIZER & | initializer | ) | [inline] |
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 >.
virtual void LibGeoDecomp::ClonableInitializerWrapper< INITIALIZER >::grid | ( | GridBase< Cell, DIM > * | target | ) | [inline, virtual] |
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 >.
virtual Coord<DIM> LibGeoDecomp::ClonableInitializerWrapper< INITIALIZER >::gridDimensions | ( | ) | const [inline, virtual] |
returns the size of the gridBox().
Implements LibGeoDecomp::Initializer< INITIALIZER::Cell >.
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 >.
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 >.
static ClonableInitializer<Cell>* LibGeoDecomp::ClonableInitializerWrapper< INITIALIZER >::wrap | ( | const INITIALIZER & | initializer | ) | [inline, static] |
INITIALIZER LibGeoDecomp::ClonableInitializerWrapper< INITIALIZER >::delegate [private] |
const int LibGeoDecomp::ClonableInitializerWrapper< INITIALIZER >::DIM = Topology::DIM [static] |
Reimplemented from LibGeoDecomp::Initializer< INITIALIZER::Cell >.