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