X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fdevicemanager.h;h=ca86a7fe9c15c69f727ccbf3b04711a8650e8250;hb=300fc11ea8ec416b31c7dbc3d3d52277af24d1b7;hp=b7f2d49a7e016ce49e6b66dc0124b17b1779dbb3;hpb=dc0867ff7ec693953afb62f9512ad7dd3339a2b2;p=pulseview.git diff --git a/pv/devicemanager.h b/pv/devicemanager.h index b7f2d49a..ca86a7fe 100644 --- a/pv/devicemanager.h +++ b/pv/devicemanager.h @@ -24,17 +24,20 @@ #include #include -#include +#include #include struct sr_context; struct sr_dev_driver; -struct sr_dev_inst; namespace pv { class SigSession; +namespace device { +class Device; +} + class DeviceManager { public: @@ -42,18 +45,13 @@ public: ~DeviceManager(); - const std::list& devices() const; - - void use_device(sr_dev_inst *sdi, SigSession *owner); + const std::list< std::shared_ptr >& + devices() const; - void release_device(sr_dev_inst *sdi); - - std::list driver_scan( + std::list< std::shared_ptr > 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(); @@ -63,13 +61,12 @@ private: 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); + static bool compare_devices(std::shared_ptr a, + std::shared_ptr b); private: struct sr_context *const _sr_ctx; - std::list _devices; - std::map _used_devices; + std::list< std::shared_ptr > _devices; }; } // namespace pv