]> sigrok.org Git - libsigrok.git/commitdiff
C++: Make Driver inherit Configurable.
authorMartin Ling <redacted>
Sat, 6 Sep 2014 12:08:29 +0000 (13:08 +0100)
committerUwe Hermann <redacted>
Mon, 8 Sep 2014 17:27:38 +0000 (19:27 +0200)
bindings/cxx/classes.cpp
bindings/cxx/include/libsigrok/libsigrok.hpp

index c515a303104d233986f13aebf812ac28acf265db..f00ff760ced69b140dd011cefbf4df94e22ab149 100644 (file)
@@ -248,6 +248,7 @@ shared_ptr<Input> Context::open_stream(string header)
 
 Driver::Driver(struct sr_dev_driver *structure) :
        ParentOwned(structure),
+       Configurable(structure, NULL, NULL),
        initialized(false)
 {
 }
index 4005c04a31642622899ddf741811f34a7682615b..557b08d1d6b5aadf5181b81e0f8813238a1ce512 100644 (file)
@@ -281,29 +281,6 @@ protected:
        friend class Driver;
 };
 
-/** A hardware driver provided by the library */
-class SR_API Driver :
-       public ParentOwned<Driver, Context, struct sr_dev_driver>
-{
-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<shared_ptr<HardwareDevice> > scan(
-               map<const ConfigKey *, Glib::VariantBase> options = {});
-protected:
-       bool initialized;
-       vector<HardwareDevice *> 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<Driver, Context, struct sr_dev_driver>,
+       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<shared_ptr<HardwareDevice> > scan(
+               map<const ConfigKey *, Glib::VariantBase> options = {});
+protected:
+       bool initialized;
+       vector<HardwareDevice *> 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
 {