ifw-core 6.0.0
Loading...
Searching...
No Matches
commMaker.hpp
Go to the documentation of this file.
1
8#ifndef CORE_PROTOCOL_BASE_COMMMAKER_HPP
9#define CORE_PROTOCOL_BASE_COMMMAKER_HPP
10
11#include <iostream>
12#include <string>
13#include <memory>
14
17
19
21 template<typename T>
22 class CommMaker : public ICommMaker {
23 public:
26 CommMaker(const std::string& key) {
28 }
29
30 virtual std::shared_ptr<IComm> Create(const std::string& filename) const {
31 return std::make_shared<T>(filename);
32 }
33 };
34}
35
36#endif // CORE_PROTOCOL_BASE_COMMMAKER_HPP
void RegisterMaker(const std::string &key, ICommMaker *maker)
Definition commFactory.cpp:20
static CommFactory & Instance()
Definition commFactory.cpp:15
Helper template to simplify the process of generating Comm-maker.
Definition commMaker.hpp:22
CommMaker(const std::string &key)
Definition commMaker.hpp:26
virtual std::shared_ptr< IComm > Create(const std::string &filename) const
Accepts node to pass into Comms constructor.
Definition commMaker.hpp:30
Definition iCommMaker.hpp:19
Definition commFactory.cpp:13