ifw-core  5.0.0-pre2
commMaker.hpp
Go to the documentation of this file.
1 
10 #ifndef CORE_PROTOCOL_BASE_COMMMAKER_HPP
11 #define CORE_PROTOCOL_BASE_COMMMAKER_HPP
12 
13 #include <iostream>
14 #include <string>
15 
18 
19 
20 namespace protocol {
21  namespace base {
22 
24  template<typename T>
25  class CommMaker : public ICommMaker
26  {
27  public:
28 // std::shared_ptr<ICommMaker> GetCommMaker() {
29 // return shared_from_this();
30 
31 // }
34  CommMaker(const std::string& key) {
36  }
37 
38  virtual std::shared_ptr<IComm> Create() const {
39  return std::make_shared<T>();
40  }
41  };
42  }
43 }
44 #endif // CORE_PROTOCOL_BASE_COMMMAKER_HPP
static CommFactory & Instance()
Definition: commFactory.cpp:18
void RegisterMaker(const std::string &key, ICommMaker *maker)
Definition: commFactory.cpp:23
Helper template to simplify the process of generating Comm-maker.
Definition: commMaker.hpp:26
CommMaker(const std::string &key)
Definition: commMaker.hpp:34
virtual std::shared_ptr< IComm > Create() const
Accepts node to pass into Comms constructor.
Definition: commMaker.hpp:38
Definition: iCommMaker.hpp:23
Definition: commFactory.cpp:15