* 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 <http://www.gnu.org/licenses/>.
*/
#include "devicemanager.hpp"
#include <cassert>
#include <functional>
-#include <stdexcept>
#include <sstream>
+#include <stdexcept>
#include <string>
-#include <vector>
#include <libsigrokcxx/libsigrokcxx.hpp>
-#include <boost/algorithm/string/join.hpp>
#include <boost/filesystem.hpp>
#include <pv/devices/hardwaredevice.hpp>
-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 {
driver_scan(entry.second, map<const ConfigKey *, VariantBase>());
}
-DeviceManager::~DeviceManager()
-{
-}
-
-const std::shared_ptr<sigrok::Context>& DeviceManager::context() const
+const shared_ptr<sigrok::Context>& DeviceManager::context() const
{
return context_;
}
// 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")
}
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;