mimmo::Creator< Base, Derived > Class Template Reference

Template class to create an object Base * = new Derived creator class, where Derived is a generic derived class of Base. Creator can be any constructor of the derived class who takes as argument a const reference to a xml-data tree bitpit::Config::Section. More...

#include <factory.hpp>

Inheritance diagram for mimmo::Creator< Base, Derived >:
Collaboration diagram for mimmo::Creator< Base, Derived >:

Public Member Functions

 Creator (CreateFn fn=nullptr)
 
virtual Derived * create (const bitpit::Config::Section &xml_root) const
 
- Public Member Functions inherited from mimmo::Factory< Base >::AbstractCreator
virtual ~AbstractCreator ()
 

Public Attributes

CreateFn createFn
 

Detailed Description

template<class Base, class Derived>
class mimmo::Creator< Base, Derived >

Template class to create an object Base * = new Derived creator class, where Derived is a generic derived class of Base. Creator can be any constructor of the derived class who takes as argument a const reference to a xml-data tree bitpit::Config::Section.

Definition at line 168 of file factory.hpp.

Constructor & Destructor Documentation

◆ Creator()

template<class Base , class Derived >
mimmo::Creator< Base, Derived >::Creator ( CreateFn  fn = nullptr)
inline

Constructor

Parameters
[in]fnCreateFn function

Definition at line 183 of file factory.hpp.

Member Function Documentation

◆ create()

template<class Base , class Derived >
virtual Derived* mimmo::Creator< Base, Derived >::create ( const bitpit::Config::Section &  xml_root) const
inlinevirtual

Function to create a new object of class Derived, with custom function of type CreateFn linked as Creator

Parameters
[in]xml_rootreference of xml-data tree
Returns
pointer to newly created object

Implements mimmo::Factory< Base >::AbstractCreator.

Definition at line 189 of file factory.hpp.

Member Data Documentation

◆ createFn

template<class Base , class Derived >
CreateFn mimmo::Creator< Base, Derived >::createFn

function linked as Creator

Definition at line 178 of file factory.hpp.


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