From: Martin Ling Date: Sat, 6 Sep 2014 12:08:29 +0000 (+0100) Subject: C++: Make Driver inherit Configurable. X-Git-Tag: libsigrok-0.4.0~1027 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=59b74d28c94b566f252ffb268314526ce14c3b33;p=libsigrok.git C++: Make Driver inherit Configurable. --- diff --git a/bindings/cxx/classes.cpp b/bindings/cxx/classes.cpp index c515a303..f00ff760 100644 --- a/bindings/cxx/classes.cpp +++ b/bindings/cxx/classes.cpp @@ -248,6 +248,7 @@ shared_ptr Context::open_stream(string header) Driver::Driver(struct sr_dev_driver *structure) : ParentOwned(structure), + Configurable(structure, NULL, NULL), initialized(false) { } diff --git a/bindings/cxx/include/libsigrok/libsigrok.hpp b/bindings/cxx/include/libsigrok/libsigrok.hpp index 4005c04a..557b08d1 100644 --- a/bindings/cxx/include/libsigrok/libsigrok.hpp +++ b/bindings/cxx/include/libsigrok/libsigrok.hpp @@ -281,29 +281,6 @@ protected: friend class Driver; }; -/** A hardware driver provided by the library */ -class SR_API Driver : - public ParentOwned -{ -public: - /** Name of this driver. */ - string get_name(); - /** Long name for this driver. */ - string get_long_name(); - /** Scan for devices and return a list of devices found. - * @param options Mapping of (ConfigKey, value) pairs. */ - vector > scan( - map options = {}); -protected: - bool initialized; - vector devices; - Driver(struct sr_dev_driver *structure); - ~Driver(); - friend class Context; - friend class HardwareDevice; - friend class ChannelGroup; -}; - /** An object that can be configured. */ class SR_API Configurable { @@ -329,6 +306,30 @@ protected: struct sr_channel_group *config_channel_group; }; +/** A hardware driver provided by the library */ +class SR_API Driver : + public ParentOwned, + public Configurable +{ +public: + /** Name of this driver. */ + string get_name(); + /** Long name for this driver. */ + string get_long_name(); + /** Scan for devices and return a list of devices found. + * @param options Mapping of (ConfigKey, value) pairs. */ + vector > scan( + map options = {}); +protected: + bool initialized; + vector devices; + Driver(struct sr_dev_driver *structure); + ~Driver(); + friend class Context; + friend class HardwareDevice; + friend class ChannelGroup; +}; + /** A generic device, either hardware or virtual */ class SR_API Device : public Configurable {