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