X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdevicemanager.h;h=0a47a35a004659b09da56ce7545135159a448939;hp=3ed74e078f2baa3234b9807eb6d62e4e2af6f7ac;hb=e8d009288de28cb194bc7964f96677c2baf900c9;hpb=945745012eb57cefa1ef457daf48cfffa99f9ec2 diff --git a/pv/devicemanager.h b/pv/devicemanager.h index 3ed74e0..0a47a35 100644 --- a/pv/devicemanager.h +++ b/pv/devicemanager.h @@ -21,61 +21,58 @@ #ifndef PULSEVIEW_PV_DEVICEMANAGER_H #define PULSEVIEW_PV_DEVICEMANAGER_H -#include - #include #include +#include #include -#include +namespace Glib { + class VariantBase; +} -struct sr_context; -struct sr_dev_driver; +namespace sigrok { + class ConfigKey; + class Context; + class Driver; + class Device; + class HardwareDevice; +} namespace pv { class SigSession; -namespace device { -class DevInst; -} - class DeviceManager { public: - DeviceManager(struct sr_context *sr_ctx); + DeviceManager(std::shared_ptr context); ~DeviceManager(); - const std::list< boost::shared_ptr >& - devices() const; - - void use_device(boost::shared_ptr dev_inst, - SigSession *owner); - - void release_device(boost::shared_ptr dev_inst); - - std::list< boost::shared_ptr > driver_scan( - struct sr_dev_driver *const driver, - GSList *const drvopts = NULL); + std::shared_ptr context(); -private: - void init_drivers(); + const std::list< std::shared_ptr >& + devices() const; - void release_devices(); + std::list< std::shared_ptr > driver_scan( + std::shared_ptr driver, + std::map drvopts); - void scan_all_drivers(); + const std::map get_device_info( + const std::shared_ptr device); - void release_driver(struct sr_dev_driver *const driver); + const std::shared_ptr find_device_from_info( + const std::map search_info); - static bool compare_devices(boost::shared_ptr a, - boost::shared_ptr b); + static std::string device_description(std::shared_ptr device); private: - struct sr_context *const _sr_ctx; - std::list< boost::shared_ptr > _devices; - std::map< boost::shared_ptr, pv::SigSession*> - _used_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