ifw-fcf
3.0.0
devmgr
common
src
include
fcf
devmgr
common
deviceFactory.hpp
Go to the documentation of this file.
1
9
#ifndef FCF_DEVMGR_COMMON_DEVICEFACTORY_HPP
10
#define FCF_DEVMGR_COMMON_DEVICEFACTORY_HPP
11
12
// System headers
13
#include <map>
14
#include <string>
15
16
// Local headers
17
#include <
fcf/devmgr/common/iDeviceMaker.hpp
>
18
19
namespace
fcf
{
20
namespace
devmgr {
21
namespace
common {
22
23
class
IDevice;
27
class
DeviceFactory
{
28
public
:
29
37
static
DeviceFactory
&
Instance
();
38
46
void
RegisterMaker
(
const
std::string& key,
IDeviceMaker
* maker);
47
48
56
void
DeregisterMaker
(
const
std::string& key,
IDeviceMaker
* maker);
57
66
std::shared_ptr<IDevice>
Create
(
const
std::string& filename,
67
const
std::string& name,
68
DataContext
& data_ctx)
const
;
69
70
private
:
71
// Disable copying and assignment
72
DeviceFactory
() {}
73
74
// Disable copying and assignment
75
DeviceFactory
(
const
DeviceFactory
& other);
76
DeviceFactory
& operator=(
const
DeviceFactory
& other);
77
78
80
std::map<std::string, IDeviceMaker* > m_makers;
81
};
82
83
}
84
}
85
}
86
87
88
89
#endif //FCF_DEVMGR_COMMON_DEVICE_FACTORY_HPP
iDeviceMaker.hpp
Config class header file.
fcf::devmgr::common::DeviceFactory::DeregisterMaker
void DeregisterMaker(const std::string &key, IDeviceMaker *maker)
Deregister device maker.
Definition:
deviceFactory.cpp:42
fcf::devmgr::common::DeviceFactory::Instance
static DeviceFactory & Instance()
Get instance of singleton.
Definition:
deviceFactory.cpp:23
fcf::devmgr::common::DataContext
Definition:
dataContext.hpp:92
fcf
Definition:
actionMgr.cpp:29
fcf::devmgr::common::IDeviceMaker
Definition:
iDeviceMaker.hpp:27
fcf::devmgr::common::DeviceFactory::RegisterMaker
void RegisterMaker(const std::string &key, IDeviceMaker *maker)
Register device maker.
Definition:
deviceFactory.cpp:30
fcf::devmgr::common::DeviceFactory::Create
std::shared_ptr< IDevice > Create(const std::string &filename, const std::string &name, DataContext &data_ctx) const
Creates a new device.
Definition:
deviceFactory.cpp:51
fcf::devmgr::common::DeviceFactory
Definition:
deviceFactory.hpp:27
Generated by
1.8.20