X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdevicemanager.h;h=b7f2d49a7e016ce49e6b66dc0124b17b1779dbb3;hp=070c3cc7d94ef202e52968333d3ec608589768bc;hb=819f4c25391a9c74d3d2f528d462142d5c4aad4d;hpb=107ca6d350b51186d12dac9273f6ed130b3f5dd7 diff --git a/pv/devicemanager.h b/pv/devicemanager.h index 070c3cc7..b7f2d49a 100644 --- a/pv/devicemanager.h +++ b/pv/devicemanager.h @@ -24,6 +24,8 @@ #include #include +#include +#include struct sr_context; struct sr_dev_driver; @@ -31,6 +33,8 @@ struct sr_dev_inst; namespace pv { +class SigSession; + class DeviceManager { public: @@ -40,23 +44,32 @@ public: const std::list& devices() const; + void use_device(sr_dev_inst *sdi, SigSession *owner); + + void release_device(sr_dev_inst *sdi); + std::list driver_scan( struct sr_dev_driver *const driver, GSList *const drvopts = NULL); + static std::string format_device_title(const sr_dev_inst *const sdi); + private: void init_drivers(); - static void release_devices(); + void release_devices(); void scan_all_drivers(); + void release_driver(struct sr_dev_driver *const driver); + static bool compare_devices(const sr_dev_inst *const a, const sr_dev_inst *const b); private: struct sr_context *const _sr_ctx; std::list _devices; + std::map _used_devices; }; } // namespace pv