X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdevicemanager.cpp;h=883175c7752eb8cf27767a254d285da3760eb539;hp=17a49774465c3d90fa7c8e3171d10bd4900c33f1;hb=83b1c8d251386ac1980284c4668cbdd8e425550f;hpb=3084ed4b15663dd717ff656745db305f377ab215 diff --git a/pv/devicemanager.cpp b/pv/devicemanager.cpp index 17a49774..883175c7 100644 --- a/pv/devicemanager.cpp +++ b/pv/devicemanager.cpp @@ -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 . */ #include "devicemanager.hpp" @@ -26,33 +25,26 @@ #include #include #include -#include #include -#include #include #include -using boost::algorithm::join; - using std::bind; -using std::dynamic_pointer_cast; using std::list; using std::map; -using std::remove_if; -using std::runtime_error; +using std::placeholders::_1; +using std::placeholders::_2; using std::shared_ptr; using std::string; -using std::vector; using Glib::VariantBase; using sigrok::ConfigKey; using sigrok::Context; using sigrok::Driver; -using sigrok::SessionDevice; namespace pv { @@ -63,11 +55,7 @@ DeviceManager::DeviceManager(shared_ptr context) : driver_scan(entry.second, map()); } -DeviceManager::~DeviceManager() -{ -} - -const std::shared_ptr& DeviceManager::context() const +const shared_ptr& DeviceManager::context() const { return context_; } @@ -149,10 +137,12 @@ const shared_ptr 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 +177,8 @@ const shared_ptr DeviceManager::find_device_from_info( } bool DeviceManager::compare_devices(shared_ptr a, - shared_ptr b) { + shared_ptr b) +{ assert(a); assert(b); return a->display_name(*this).compare(b->display_name(*this)) < 0;