From 2c0f1098351d6c0763d985c2085ec676a7992e2d Mon Sep 17 00:00:00 2001 From: Paul David Date: Tue, 9 May 2017 21:36:02 -0400 Subject: Types: Added equality/inquality operators to support Boost.Python additions - Added to subdev_spec_pair_t - Added to range_t - Added tests for the inequalities --- host/lib/usrp/subdev_spec.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'host/lib/usrp') diff --git a/host/lib/usrp/subdev_spec.cpp b/host/lib/usrp/subdev_spec.cpp index e59160a71..b7eb64f87 100644 --- a/host/lib/usrp/subdev_spec.cpp +++ b/host/lib/usrp/subdev_spec.cpp @@ -43,6 +43,14 @@ bool usrp::operator==(const subdev_spec_pair_t &lhs, const subdev_spec_pair_t &r return (lhs.db_name == rhs.db_name) and (lhs.sd_name == rhs.sd_name); } +bool subdev_spec_pair_t::operator==(const subdev_spec_pair_t &other){ + return (other.db_name == db_name) and (other.sd_name == sd_name); +} + +bool subdev_spec_pair_t::operator!=(const subdev_spec_pair_t &other){ + return (other.db_name != db_name) or (other.sd_name != sd_name); +} + subdev_spec_t::subdev_spec_t(const std::string &markup){ for(const std::string &pair: pair_tokenizer(markup)){ if (pair.empty()) continue; -- cgit v1.2.3