29 : frequencyRangeBegin_(0), frequencyRangeEnd_(0), maxBandwidth_(0), maxAntennaGain_(0), maxEIRP_(0), flags_(0), cacTime_(0)
35 return frequencyRangeBegin_;
41 return frequencyRangeEnd_;
65 return maxAntennaGain_;
68 #define FLAG_GETSET_IMPL( member, flag) \ 69 prefix_ bool senf::emu::RegulatoryRule::member() \ 72 return flags_ & Flags::flag; \ 74 prefix_ senf::emu::RegulatoryRule & senf::emu::RegulatoryRule::member(bool f) \ 76 if (f) flags_ |= Flags::flag; \ 77 else flags_ &= ~Flags::flag; \ 91 #undef FLAG_GETSET_IMPL 101 frequencyRangeBegin_ = begin;
102 frequencyRangeEnd_ = end;
108 maxBandwidth_ = bandwidth;
126 maxAntennaGain_ = gain;
139 return frequencyRangeBegin_ == other.frequencyRangeBegin_ &&
140 frequencyRangeEnd_ == other.frequencyRangeEnd_ &&
141 maxBandwidth_ == other.maxBandwidth_ &&
142 maxAntennaGain_ == other.maxAntennaGain_ &&
143 maxEIRP_ == other.maxEIRP_ &&
144 cacTime_ == other.cacTime_ &&
145 flags_ == other.flags_;
160 #define GTLT( a) if (a < other.a) return true; if (other.a < a) return false; 162 GTLT( frequencyRangeBegin_);
163 GTLT( frequencyRangeEnd_);
164 GTLT( maxBandwidth_);
165 GTLT( maxAntennaGain_);
180 return frequencyRangeBegin_ == other.frequencyRangeBegin_ &&
181 frequencyRangeEnd_ == other.frequencyRangeEnd_ &&
182 maxBandwidth_ == other.maxBandwidth_ &&
183 maxEIRP_ == other.maxEIRP_ &&
184 flags_ == other.flags_;
187 prefix_ senf::emu::RegulatoryDomain::operator bool()
190 return !rules.empty();
199 if (rules.size() != other.
rules.size())
202 for(
auto const & r: rules) {
217 if (rules.size() < other.
rules.size())
219 if (other.
rules.size() < rules.size())
222 if (
int(dfsRegion) < int(other.
dfsRegion))
224 if (
int(other.
dfsRegion) < int(dfsRegion))
227 auto left (rules.begin());
228 auto right (other.
rules.begin());
229 while ((left != rules.end()) && (right != other.
rules.end())) {
247 if (rules.size() != other.
rules.size())
250 for(
auto const & r: rules) {
252 for(
auto const & o: other.
rules) {
253 if (r.isEqualKernel(o)){
267 senf::console::format(regDomain, os);
276 senf::console::format(
flags, os);
285 senf::console::parse( *(arg++), rule.frequencyRangeBegin_ );
286 senf::console::parse( *(arg++), rule.frequencyRangeEnd_ );
287 senf::console::parse( *(arg++), rule.maxBandwidth_ );
288 senf::console::parse( *(arg++), rule.maxEIRP_ );
289 senf::console::parse( *(arg++), rule.cacTime_ );
291 senf::console::parse( *(arg++), flags );
297 return "RegulatoryRule";
302 std::stringstream ss;
308 type const & info, std::ostream & os)
bool isEqualKernel(RegulatoryDomain const &other) const
RegulatoryRule & maxEIRP(std::int32_t eirp)
RegulatoryRule & frequencyRange(std::uint32_t lower, std::uint32_t upper)
std::uint32_t cacTime() const
std::int32_t maxAntennaGain() const
bool operator==(RegulatoryDomain const &other) const
bool operator<(RegulatoryDomain const &other) const
bool operator<(RegulatoryRule const &other) const
std::int32_t maxEIRP() const
std::set< RegulatoryRule > rules
std::uint32_t frequencyRangeEnd() const
bool operator==(RegulatoryRule const &other) const
static std::string str(Type const &value)
static void parse(ParseCommandInfo::TokensRange const &tokens, Type &out)
static std::string description()
#define FLAG_GETSET_IMPL(member, flag)
RegulatoryRule & cacTime(std::uint32_t cac)
std::uint32_t frequencyRangeBegin() const
RegulatoryRule & flags(std::uint32_t f)
std::uint32_t maxBandwidth() const
RegulatoryRule & maxBandwidth(std::uint32_t bandwidth)
std::uint32_t flags() const
std::ostream & operator<<(std::ostream &os, InterfaceDeviceId const &id)
boost::iterator_range< token_iterator > TokensRange
static void format(Type const &value, std::ostream &os)
bool isEqualKernel(RegulatoryRule const &other) const