]> sigrok.org Git - pulseview.git/blobdiff - pv/devicemanager.hpp
MainWindow: Enable dock nesting
[pulseview.git] / pv / devicemanager.hpp
index fa116223305a179884c27d400d76b25c53e87caa..d0d11cbd4d7095bcf7f1b3fede305bd83a8a711e 100644 (file)
@@ -18,8 +18,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
-#ifndef PULSEVIEW_PV_DEVICEMANAGER_H
-#define PULSEVIEW_PV_DEVICEMANAGER_H
+#ifndef PULSEVIEW_PV_DEVICEMANAGER_HPP
+#define PULSEVIEW_PV_DEVICEMANAGER_HPP
 
 #include <list>
 #include <map>
 #include <string>
 
 namespace Glib {
-       class VariantBase;
+class VariantBase;
 }
 
 namespace sigrok {
-       class ConfigKey;
-       class Context;
-       class Driver;
-       class Device;
-       class HardwareDevice;
+class ConfigKey;
+class Context;
+class Driver;
 }
 
 namespace pv {
 
+namespace devices {
+class Device;
+class HardwareDevice;
+}
+
 class Session;
 
 class DeviceManager
@@ -47,39 +50,34 @@ class DeviceManager
 public:
        DeviceManager(std::shared_ptr<sigrok::Context> context);
 
-       ~DeviceManager();
+       ~DeviceManager() = default;
+
+       const std::shared_ptr<sigrok::Context>& context() const;
 
        std::shared_ptr<sigrok::Context> context();
 
-       const std::list< std::shared_ptr<sigrok::HardwareDevice> >&
+       const std::list< std::shared_ptr<devices::HardwareDevice> >&
                devices() const;
 
-       std::list< std::shared_ptr<sigrok::HardwareDevice> > driver_scan(
+       std::list< std::shared_ptr<devices::HardwareDevice> > driver_scan(
                std::shared_ptr<sigrok::Driver> driver,
                std::map<const sigrok::ConfigKey *, Glib::VariantBase> drvopts);
 
        const std::map<std::string, std::string> get_device_info(
-               const std::shared_ptr<sigrok::Device> device);
+               const std::shared_ptr<devices::Device> device);
 
-       const std::shared_ptr<sigrok::HardwareDevice> find_device_from_info(
+       const std::shared_ptr<devices::HardwareDevice> find_device_from_info(
                const std::map<std::string, std::string> search_info);
 
-       const std::string build_display_name(std::shared_ptr<sigrok::Device> device);
-
-       const std::string get_display_name(std::shared_ptr<sigrok::Device> dev);
-
-       void update_display_name(std::shared_ptr<sigrok::Device> dev);
-
 private:
-       bool compare_devices(std::shared_ptr<sigrok::Device> a,
-               std::shared_ptr<sigrok::Device> b);
+       bool compare_devices(std::shared_ptr<devices::Device> a,
+               std::shared_ptr<devices::Device> b);
 
 protected:
        std::shared_ptr<sigrok::Context> context_;
-       std::list< std::shared_ptr<sigrok::HardwareDevice> > devices_;
-       std::map< std::shared_ptr<sigrok::Device>, std::string > display_names_;
+       std::list< std::shared_ptr<devices::HardwareDevice> > devices_;
 };
 
 } // namespace pv
 
-#endif // PULSEVIEW_PV_DEVICEMANAGER_H
+#endif // PULSEVIEW_PV_DEVICEMANAGER_HPP