X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdevicemanager.hpp;h=9b8ef3d120a3a4c68f97a9e359156270516ed4eb;hp=fa116223305a179884c27d400d76b25c53e87caa;hb=dbed5609ae31cdfc3e9db10f3ab91b7607c08372;hpb=2b81ae4682ade4109ffa442794de36ceb32045eb diff --git a/pv/devicemanager.hpp b/pv/devicemanager.hpp index fa116223..9b8ef3d1 100644 --- a/pv/devicemanager.hpp +++ b/pv/devicemanager.hpp @@ -14,72 +14,88 @@ * 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_H -#define PULSEVIEW_PV_DEVICEMANAGER_H +#ifndef PULSEVIEW_PV_DEVICEMANAGER_HPP +#define PULSEVIEW_PV_DEVICEMANAGER_HPP #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); - std::shared_ptr context(); + ~DeviceManager() = default; - const std::list< std::shared_ptr >& - devices() const; + const shared_ptr& context() const; - std::list< std::shared_ptr > driver_scan( - std::shared_ptr driver, - std::map drvopts); + shared_ptr context(); - const std::map get_device_info( - const std::shared_ptr device); + const list< shared_ptr >& devices() const; + shared_ptr user_spec_device() const; - const std::shared_ptr find_device_from_info( - const std::map search_info); + bool driver_supported(shared_ptr driver) const; - const std::string build_display_name(std::shared_ptr device); + list< shared_ptr > driver_scan( + shared_ptr driver, + map drvopts); - const std::string get_display_name(std::shared_ptr dev); + const map get_device_info( + const shared_ptr device); - 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); + + static map + drive_scan_options(vector user_spec, + set driver_opts); protected: - std::shared_ptr context_; - std::list< std::shared_ptr > devices_; - std::map< std::shared_ptr, std::string > display_names_; + shared_ptr context_; + list< shared_ptr > devices_; + shared_ptr user_spec_device_; }; } // namespace pv -#endif // PULSEVIEW_PV_DEVICEMANAGER_H +#endif // PULSEVIEW_PV_DEVICEMANAGER_HPP