]> sigrok.org Git - pulseview.git/blobdiff - pv/devicemanager.h
Pass new unit_size argument to srd_inst_probe_set_all()
[pulseview.git] / pv / devicemanager.h
index 070c3cc7d94ef202e52968333d3ec608589768bc..891ba3d2c1ac28a254917a7da49def32828779d2 100644 (file)
 #include <glib.h>
 
 #include <list>
+#include <map>
+#include <string>
+
+#include <boost/shared_ptr.hpp>
 
 struct sr_context;
 struct sr_dev_driver;
-struct sr_dev_inst;
 
 namespace pv {
 
+class DevInst;
+class SigSession;
+
 class DeviceManager
 {
 public:
@@ -38,25 +44,34 @@ public:
 
        ~DeviceManager();
 
-       const std::list<sr_dev_inst*>& devices() const;
+       const std::list< boost::shared_ptr<pv::DevInst> >& devices() const;
+
+       void use_device(boost::shared_ptr<pv::DevInst> dev_inst,
+               SigSession *owner);
 
-       std::list<sr_dev_inst*> driver_scan(
+       void release_device(boost::shared_ptr<pv::DevInst> dev_inst);
+
+       std::list< boost::shared_ptr<DevInst> > driver_scan(
                struct sr_dev_driver *const driver,
                GSList *const drvopts = NULL);
 
 private:
        void init_drivers();
 
-       static void release_devices();
+       void release_devices();
 
        void scan_all_drivers();
 
-       static bool compare_devices(const sr_dev_inst *const a,
-               const sr_dev_inst *const b);
+       void release_driver(struct sr_dev_driver *const driver);
+
+       static bool compare_devices(boost::shared_ptr<DevInst> a,
+               boost::shared_ptr<DevInst> b);
 
 private:
        struct sr_context *const _sr_ctx;
-       std::list<sr_dev_inst*> _devices;
+       std::list< boost::shared_ptr<pv::DevInst> > _devices;
+       std::map< boost::shared_ptr<pv::DevInst>, pv::SigSession*>
+               _used_devices;
 };
 
 } // namespace pv