aboutsummaryrefslogtreecommitdiff
path: root/src/device/device.hpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2018-09-18 17:29:26 +0200
committerRiccardo Spagni <ric@spagni.net>2018-09-18 17:29:26 +0200
commitb4a9ebad6c43205225be9ad9634ff2a31527d987 (patch)
tree33b1623bb80cc940477088bd7333b4615d287462 /src/device/device.hpp
parentMerge pull request #4273 (diff)
parenthw_device: support for multiple devices added [for review] (diff)
downloadmonero-b4a9ebad6c43205225be9ad9634ff2a31527d987.tar.xz
Merge pull request #4299
f9b22a7b hw_device: support for multiple devices added [for review] (Dusan Klinec)
Diffstat (limited to 'src/device/device.hpp')
-rw-r--r--src/device/device.hpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/device/device.hpp b/src/device/device.hpp
index c21456daf..d14b8848c 100644
--- a/src/device/device.hpp
+++ b/src/device/device.hpp
@@ -202,6 +202,17 @@ namespace hw {
~reset_mode() { hwref.set_mode(hw::device::NONE);}
};
- device& get_device(const std::string device_descriptor) ;
+ class device_registry {
+ private:
+ std::map<std::string, std::unique_ptr<device>> registry;
+
+ public:
+ device_registry();
+ bool register_device(const std::string & device_name, device * hw_device);
+ device& get_device(const std::string & device_descriptor);
+ };
+
+ device& get_device(const std::string & device_descriptor);
+ bool register_device(const std::string & device_name, device * hw_device);
}