X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdevicemanager.h;h=0a47a35a004659b09da56ce7545135159a448939;hp=070c3cc7d94ef202e52968333d3ec608589768bc;hb=e8d009288de28cb194bc7964f96677c2baf900c9;hpb=107ca6d350b51186d12dac9273f6ed130b3f5dd7 diff --git a/pv/devicemanager.h b/pv/devicemanager.h index 070c3cc..0a47a35 100644 --- a/pv/devicemanager.h +++ b/pv/devicemanager.h @@ -21,42 +21,58 @@ #ifndef PULSEVIEW_PV_DEVICEMANAGER_H #define PULSEVIEW_PV_DEVICEMANAGER_H -#include - #include - -struct sr_context; -struct sr_dev_driver; -struct sr_dev_inst; +#include +#include +#include + +namespace Glib { + class VariantBase; +} + +namespace sigrok { + class ConfigKey; + class Context; + class Driver; + class Device; + class HardwareDevice; +} namespace pv { +class SigSession; + class DeviceManager { public: - DeviceManager(struct sr_context *sr_ctx); + DeviceManager(std::shared_ptr context); ~DeviceManager(); - const std::list& devices() const; + std::shared_ptr context(); - std::list driver_scan( - struct sr_dev_driver *const driver, - GSList *const drvopts = NULL); + const std::list< std::shared_ptr >& + devices() const; -private: - void init_drivers(); + std::list< std::shared_ptr > driver_scan( + std::shared_ptr driver, + std::map drvopts); - static void release_devices(); + const std::map get_device_info( + const std::shared_ptr device); - void scan_all_drivers(); + const std::shared_ptr find_device_from_info( + const std::map search_info); - static bool compare_devices(const sr_dev_inst *const a, - const sr_dev_inst *const b); + static std::string device_description(std::shared_ptr device); private: - struct sr_context *const _sr_ctx; - std::list _devices; + static bool compare_devices(std::shared_ptr a, + std::shared_ptr b); + +protected: + std::shared_ptr _context; + std::list< std::shared_ptr > _devices; }; } // namespace pv