Phoxonics  1.0
Object Oriented FDTD Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
EngineFactoryReg.hpp
Go to the documentation of this file.
1 /*
2  * EngineFactoryReg.hpp
3  *
4  * Created on: Oct 23, 2014
5  * Author: cuda
6  */
7 
8 #ifndef ENGINEFACTORYREG_HPP_
9 #define ENGINEFACTORYREG_HPP_
10 
11 #include "EngineFactory.hpp"
12 #include "EngineBase.hpp"
13 #include "../common/FactoryBase.hpp"
14 #include "../../../common/common.hpp"
15 
16 namespace phoxonics {
17 namespace core {
18 
19 template<class T>
20 class EngineFactoryReg : public FactoryBase {
21 public:
22  explicit EngineFactoryReg(std::string class_name) {
23  this->log_.log_trac(__PRETTY_FUNCTION__);
24  // register the class factory function
26  [](void) -> EngineBase* {return new T();});
27 
28  };
29 };
30 
31 } /* namespace core */
32 } /* namespace phoxonics */
33 
34 #endif /* ENGINEFACTORYREG_HPP_ */
void log_trac(std::string message)
Definition: Logger.cpp:28
Definition: CommonBase.hpp:14
phoxonics::common::Logger log_
Definition: FactoryBase.hpp:19
Definition: FactoryBase.hpp:16
static EngineFactory * instance()
Definition: EngineFactory.cpp:17
Definition: EngineFactoryReg.hpp:20
void register_factory_function(std::string class_name, std::function< EngineBase *(void)> class_factory_function)
Definition: EngineFactory.cpp:22
EngineFactoryReg(std::string class_name)
Definition: EngineFactoryReg.hpp:22
Definition: EngineBase.hpp:26