X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdevicemanager.hpp;h=9b8ef3d120a3a4c68f97a9e359156270516ed4eb;hp=b99a047c6327100f9f0d15fb9b92f0ece53d418a;hb=72486b789078f024e4f3404f81118c03b03e2b70;hpb=72d85f366c78efac46c3332cfbfe11e73c5765a2 diff --git a/pv/devicemanager.hpp b/pv/devicemanager.hpp index b99a047c..9b8ef3d1 100644 --- a/pv/devicemanager.hpp +++ b/pv/devicemanager.hpp @@ -14,8 +14,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * along with this program; if not, see . */ #ifndef PULSEVIEW_PV_DEVICEMANAGER_HPP @@ -24,66 +23,77 @@ #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; +class VariantBase; } namespace sigrok { - class ConfigKey; - class Context; - class Driver; - class Device; - class HardwareDevice; +class ConfigKey; +class Context; +class Driver; } +using sigrok::ConfigKey; + namespace pv { +namespace devices { +class Device; +class HardwareDevice; +} + class Session; class DeviceManager { public: - DeviceManager(std::shared_ptr context); - - ~DeviceManager(); + DeviceManager(shared_ptr context, + std::string driver, bool do_scan); - const std::shared_ptr& context() const; + ~DeviceManager() = default; - std::shared_ptr context(); + const shared_ptr& context() const; - const std::list< std::shared_ptr >& - devices() const; + shared_ptr context(); - std::list< std::shared_ptr > driver_scan( - std::shared_ptr driver, - std::map drvopts); + const list< shared_ptr >& devices() const; + shared_ptr user_spec_device() const; - const std::map get_device_info( - const std::shared_ptr device); + bool driver_supported(shared_ptr driver) const; - const std::shared_ptr find_device_from_info( - const std::map search_info); + list< shared_ptr > driver_scan( + shared_ptr driver, + map drvopts); - void build_display_name(std::shared_ptr device); + const map get_device_info( + const shared_ptr device); - const std::string get_display_name(std::shared_ptr dev); - - const std::string get_full_name(std::shared_ptr dev); - - void update_display_name(std::shared_ptr dev); + 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); -protected: - std::shared_ptr context_; - std::list< std::shared_ptr > devices_; + static map + drive_scan_options(vector user_spec, + set driver_opts); - std::map< std::shared_ptr, std::string > display_names_; - std::map< std::shared_ptr, std::string > full_names_; +protected: + shared_ptr context_; + list< shared_ptr > devices_; + shared_ptr user_spec_device_; }; } // namespace pv