X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fdevicemanager.h;h=823cb2bc9542ee8632690be4780db421a8bcc1de;hb=8dbbc7f0b9ea59d0f0d62225772f8a56eee125f5;hp=0a8f2e0dca7d24fedb53cf7b734d321320ff180a;hpb=6842b5fc481eb43d9aeea81f17e211820d6dc405;p=pulseview.git diff --git a/pv/devicemanager.h b/pv/devicemanager.h index 0a8f2e0..823cb2b 100644 --- a/pv/devicemanager.h +++ b/pv/devicemanager.h @@ -21,56 +21,63 @@ #ifndef PULSEVIEW_PV_DEVICEMANAGER_H #define PULSEVIEW_PV_DEVICEMANAGER_H -#include - #include #include #include #include -struct sr_context; -struct sr_dev_driver; +namespace Glib { + class VariantBase; +} + +namespace sigrok { + class ConfigKey; + class Context; + class Driver; + class Device; + class HardwareDevice; +} namespace pv { class SigSession; -namespace device { -class Device; -} - class DeviceManager { public: - DeviceManager(struct sr_context *sr_ctx); + DeviceManager(std::shared_ptr context); ~DeviceManager(); - const std::list< std::shared_ptr >& - devices() const; + std::shared_ptr context(); - std::list< std::shared_ptr > driver_scan( - struct sr_dev_driver *const driver, - GSList *const drvopts = NULL); + const std::list< std::shared_ptr >& + devices() const; - const std::shared_ptr find_device_from_info( - const std::map search_info); + std::list< std::shared_ptr > driver_scan( + std::shared_ptr driver, + std::map drvopts); -private: - void init_drivers(); + const std::map get_device_info( + const std::shared_ptr device); - void release_devices(); + const std::shared_ptr find_device_from_info( + const std::map search_info); - void scan_all_drivers(); + const std::string build_display_name(std::shared_ptr device); - void release_driver(struct sr_dev_driver *const driver); + const std::string get_display_name(std::shared_ptr dev); - static bool compare_devices(std::shared_ptr a, - std::shared_ptr b); + void update_display_name(std::shared_ptr dev); private: - struct sr_context *const _sr_ctx; - std::list< std::shared_ptr > _devices; + bool compare_devices(std::shared_ptr a, + std::shared_ptr b); + +protected: + std::shared_ptr context_; + std::list< std::shared_ptr > devices_; + std::map< std::shared_ptr, std::string > display_names_; }; } // namespace pv