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>
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()
|
inline |
Member Function Documentation
◆ create()
|
inlinevirtual |
Function to create a new object of class Derived, with custom function of type CreateFn linked as Creator
- Parameters
-
[in] xml_root reference 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
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:
- src/common/factory.hpp