X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fdevicemanager.h;h=b7f2d49a7e016ce49e6b66dc0124b17b1779dbb3;hb=dc0867ff7ec693953afb62f9512ad7dd3339a2b2;hp=f4be73b9274565e93832becba4e01985a54dece0;hpb=b47d951efad3b51674e5af2fcfc29526cad6697f;p=pulseview.git diff --git a/pv/devicemanager.h b/pv/devicemanager.h index f4be73b..b7f2d49 100644 --- a/pv/devicemanager.h +++ b/pv/devicemanager.h @@ -24,6 +24,7 @@ #include #include +#include #include struct sr_context; @@ -32,6 +33,8 @@ struct sr_dev_inst; namespace pv { +class SigSession; + class DeviceManager { public: @@ -41,6 +44,10 @@ 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); @@ -50,16 +57,19 @@ public: 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