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