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