ifw-fcf
4.1.0-pre2
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 <utils/bat/logger.hpp>
18
#include <
fcf/devmgr/common/iDeviceMaker.hpp
>
19
20
namespace
fcf
{
21
namespace
devmgr {
22
namespace
common {
23
24
class
IDevice;
28
class
DeviceFactory
{
29
public
:
30
38
static
DeviceFactory
&
Instance
();
39
47
void
RegisterMaker
(
const
std::string& key,
IDeviceMaker
* maker);
48
49
57
void
DeregisterMaker
(
const
std::string& key,
IDeviceMaker
* maker);
58
67
std::shared_ptr<IDevice>
Create
(
const
std::string& filename,
68
const
std::string& name,
69
const
std::string&
type
,
70
DataContext
& data_ctx)
const
;
71
72
private
:
73
// Disable copying and assignment
74
DeviceFactory
() {};
75
76
// Disable copying and assignment
77
DeviceFactory
(
const
DeviceFactory
& other);
78
DeviceFactory
& operator=(
const
DeviceFactory
& other);
79
80
82
std::map<std::string, IDeviceMaker* > m_makers;
83
log4cplus::Logger m_logger;
84
};
85
86
}
87
}
88
}
89
90
91
92
#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:49
fcf::devmgr::common::DeviceFactory::Instance
static DeviceFactory & Instance()
Get instance of singleton.
Definition:
deviceFactory.cpp:29
fcf::devmgr::common::DataContext
Definition:
dataContext.hpp:90
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:37
fcfcli.type
type
Definition:
fcfcli.py:32
fcf::devmgr::common::DeviceFactory::Create
std::shared_ptr< IDevice > Create(const std::string &filename, const std::string &name, const std::string &type, DataContext &data_ctx) const
Creates a new device.
Definition:
deviceFactory.cpp:58
fcf::devmgr::common::DeviceFactory
Definition:
deviceFactory.hpp:28
Generated by
1.8.20