Public Types | Public Member Functions

LibGeoDecomp::ClonableInitializer< CELL > Class Template Reference

This extension of the Initializer interface allows library classes to create copies (clones) of a particular instance, which is necessary in some use cases, e.g. More...

#include <clonableinitializer.h>

Inherits LibGeoDecomp::Initializer< CELL >.

Collaboration diagram for LibGeoDecomp::ClonableInitializer< CELL >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef void IsClonable

Public Member Functions

virtual ClonableInitializer
< CELL > * 
clone () const =0
 "virtual copy constructor".

Detailed Description

template<typename CELL>
class LibGeoDecomp::ClonableInitializer< CELL >

This extension of the Initializer interface allows library classes to create copies (clones) of a particular instance, which is necessary in some use cases, e.g.

simulation factories or the HPX backend.

We're adding this as a separate class to avoid forcing all users to add a clone() to their Initializers (e.g. via inheritance from Clonable<>. We can still add the default cause (copy c-tor) via a wrapper class.


Member Typedef Documentation

template<typename CELL>
typedef void LibGeoDecomp::ClonableInitializer< CELL >::IsClonable

Member Function Documentation

template<typename CELL>
virtual ClonableInitializer<CELL>* LibGeoDecomp::ClonableInitializer< CELL >::clone (  )  const [pure 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.

Implemented in LibGeoDecomp::ClonableInitializerWrapper< INITIALIZER >.


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