From 14635f49813df1699569d3b13456ea33955de54b Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Sun, 13 Jan 2019 12:04:31 +0100 Subject: Add Device::create static method The method makes it easier to create a std::shared_ptr from a model enum instance. --- libnitrokey/device.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libnitrokey/device.h') diff --git a/libnitrokey/device.h b/libnitrokey/device.h index 418d335..eab3888 100644 --- a/libnitrokey/device.h +++ b/libnitrokey/device.h @@ -24,6 +24,7 @@ #include #include "hidapi/hidapi.h" #include +#include #include #include #include "misc.h" @@ -154,6 +155,11 @@ public: */ static std::vector enumerate(); + /** + * Create a Device of the given model. + */ + static std::shared_ptr create(DeviceModel model); + void show_stats(); // ErrorCounters get_stats(){ return m_counters; } -- cgit v1.2.1