]> sigrok.org Git - pulseview.git/blobdiff - pv/device/devinst.h
Don't use Qt-defined keywords, they can cause problems with other headers.
[pulseview.git] / pv / device / devinst.h
index 6e81f49c686fcc8ab1424ed2836ae6e859e5e348..4f0b6dec3137fedf5f679b4b015f27cacee02703 100644 (file)
 #ifndef PULSEVIEW_PV_DEVICE_DEVINST_H
 #define PULSEVIEW_PV_DEVICE_DEVINST_H
 
+#include <memory>
 #include <string>
 
-#include <boost/shared_ptr.hpp>
-
 #include <QObject>
 
 #include <glib.h>
 #include <stdint.h>
 
 struct sr_dev_inst;
-struct sr_probe;
-struct sr_probe_group;
+struct sr_channel;
+struct sr_channel_group;
+
+#include <pv/sigsession.h>
 
 namespace pv {
+
 namespace device {
 
 class DevInst : public QObject
@@ -43,20 +45,26 @@ class DevInst : public QObject
        Q_OBJECT
 
 protected:
-       DevInst(sr_dev_inst *sdi);
+       DevInst();
 
 public:
-       sr_dev_inst* dev_inst() const;
+       virtual sr_dev_inst* dev_inst() const = 0;
+
+       virtual void use(SigSession *owner) throw(QString);
+
+       virtual void release();
+
+       SigSession* owner() const;
 
        virtual std::string format_device_title() const = 0;
 
-       GVariant* get_config(const sr_probe_group *group, int key);
+       GVariant* get_config(const sr_channel_group *group, int key);
 
-       bool set_config(const sr_probe_group *group, int key, GVariant *data);
+       bool set_config(const sr_channel_group *group, int key, GVariant *data);
 
-       GVariant* list_config(const sr_probe_group *group, int key);
+       GVariant* list_config(const sr_channel_group *group, int key);
 
-       void enable_probe(const sr_probe *probe, bool enable = true);
+       void enable_probe(const sr_channel *probe, bool enable = true);
 
        /**
         * @brief Gets the sample limit from the driver.
@@ -66,11 +74,18 @@ public:
         */
        uint64_t get_sample_limit();
 
-signals:
+       virtual bool is_trigger_enabled() const;
+
+public:
+       virtual void start();
+
+       virtual void run();
+
+Q_SIGNALS:
        void config_changed();
 
 protected:
-       sr_dev_inst *const _sdi;
+       SigSession *_owner;
 };
 
 } // device