]> sigrok.org Git - pulseview.git/blobdiff - pv/devicemanager.cpp
Connect dialog: Add support for connecting to raw-tcp devices
[pulseview.git] / pv / devicemanager.cpp
index 17a49774465c3d90fa7c8e3171d10bd4900c33f1..41f2ae9c5f5bc6346aff24b895062d1e8d51ae53 100644 (file)
@@ -41,6 +41,8 @@ using std::bind;
 using std::dynamic_pointer_cast;
 using std::list;
 using std::map;
+using std::placeholders::_1;
+using std::placeholders::_2;
 using std::remove_if;
 using std::runtime_error;
 using std::shared_ptr;
@@ -63,10 +65,6 @@ DeviceManager::DeviceManager(shared_ptr<Context> context) :
                driver_scan(entry.second, map<const ConfigKey *, VariantBase>());
 }
 
-DeviceManager::~DeviceManager()
-{
-}
-
 const std::shared_ptr<sigrok::Context>& DeviceManager::context() const
 {
        return context_;
@@ -149,10 +147,12 @@ const shared_ptr<devices::HardwareDevice> DeviceManager::find_device_from_info(
 
                // If present, vendor and model always have to match.
                if (dev_info.count("vendor") > 0 && search_info.count("vendor") > 0)
-                       if (dev_info.at("vendor") != search_info.at("vendor")) continue;
+                       if (dev_info.at("vendor") != search_info.at("vendor"))
+                               continue;
 
                if (dev_info.count("model") > 0 && search_info.count("model") > 0)
-                       if (dev_info.at("model") != search_info.at("model")) continue;
+                       if (dev_info.at("model") != search_info.at("model"))
+                               continue;
 
                // Most unique match: vendor/model/serial_num (but don't match a S/N of 0)
                if ((dev_info.count("serial_num") > 0) && (dev_info.at("serial_num") != "0")
@@ -187,7 +187,8 @@ const shared_ptr<devices::HardwareDevice> DeviceManager::find_device_from_info(
 }
 
 bool DeviceManager::compare_devices(shared_ptr<devices::Device> a,
-       shared_ptr<devices::Device> b) {
+       shared_ptr<devices::Device> b)
+{
        assert(a);
        assert(b);
        return a->display_name(*this).compare(b->display_name(*this)) < 0;