9 #ifndef DEVMGR_COMMON_DEVICEMAKER_HPP
10 #define DEVMGR_COMMON_DEVICEMAKER_HPP
16 #include <devmgr/common/iDeviceMaker.hpp>
17 #include <devmgr/common/deviceFactory.hpp>
29 class DeviceMaker :
public IDeviceMaker {
53 virtual std::shared_ptr<IDevice>
Create(
const std::string& filename,
54 const std::string&
name,
58 return std::make_shared<T>(filename,
name, data_ctx);
63 #endif // DEVMGR_COMMON_DEVICEMAKER_HPP
virtual std::shared_ptr< IDevice > Create(const std::string &filename, const std::string &name, DataContext &data_ctx) const
Create an instance of a device.
Definition: deviceMaker.hpp:53
Definition: dataContext.hpp:73
static DeviceFactory & Instance()
Get instance of singleton.
Definition: deviceFactory.cpp:22
void RegisterMaker(const std::string &key, IDeviceMaker *maker)
Register device maker.
Definition: deviceFactory.cpp:29
optional string name
Definition: topics.proto:50
DeviceMaker(const std::string &key)
DeviceMaker constructor.
Definition: deviceMaker.hpp:41