X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdevicemanager.hpp;h=9b8ef3d120a3a4c68f97a9e359156270516ed4eb;hp=145f9e80a44e68fbfa96bafe027a4a2781c89e75;hb=46ebcd3f6f85092a9eb6401f6f56cee8fa08131a;hpb=efdec55aec1a137460fa362a381ed1904182bfed diff --git a/pv/devicemanager.hpp b/pv/devicemanager.hpp index 145f9e80..9b8ef3d1 100644 --- a/pv/devicemanager.hpp +++ b/pv/devicemanager.hpp @@ -23,7 +23,16 @@ #include #include #include +#include #include +#include + +using std::list; +using std::map; +using std::set; +using std::shared_ptr; +using std::string; +using std::vector; namespace Glib { class VariantBase; @@ -35,6 +44,8 @@ class Context; class Driver; } +using sigrok::ConfigKey; + namespace pv { namespace devices { @@ -47,34 +58,42 @@ class Session; class DeviceManager { public: - DeviceManager(std::shared_ptr context); + DeviceManager(shared_ptr context, + std::string driver, bool do_scan); ~DeviceManager() = default; - const std::shared_ptr& context() const; + const shared_ptr& context() const; - std::shared_ptr context(); + shared_ptr context(); - const std::list< std::shared_ptr >& - devices() const; + const list< shared_ptr >& devices() const; + shared_ptr user_spec_device() const; - std::list< std::shared_ptr > driver_scan( - std::shared_ptr driver, - std::map drvopts); + bool driver_supported(shared_ptr driver) const; - const std::map get_device_info( - const std::shared_ptr device); + list< shared_ptr > driver_scan( + shared_ptr driver, + map drvopts); - const std::shared_ptr find_device_from_info( - const std::map search_info); + const map get_device_info( + const shared_ptr device); + + const shared_ptr find_device_from_info( + const map search_info); private: - bool compare_devices(std::shared_ptr a, - std::shared_ptr b); + bool compare_devices(shared_ptr a, + shared_ptr b); + + static map + drive_scan_options(vector user_spec, + set driver_opts); protected: - std::shared_ptr context_; - std::list< std::shared_ptr > devices_; + shared_ptr context_; + list< shared_ptr > devices_; + shared_ptr user_spec_device_; }; } // namespace pv