2013-07-31 07:29:42 -04:00
|
|
|
#include "countriesworked.h"
|
|
|
|
|
2018-10-24 19:00:19 -04:00
|
|
|
#include <set>
|
|
|
|
|
|
|
|
#include "pimpl_impl.hpp"
|
2013-07-31 07:29:42 -04:00
|
|
|
|
2018-10-24 19:00:19 -04:00
|
|
|
class CountriesWorkedimpl final
|
2013-07-31 07:29:42 -04:00
|
|
|
{
|
2018-10-24 19:00:19 -04:00
|
|
|
public:
|
|
|
|
// element is country-name+band where the '+' is actual a character
|
|
|
|
// which allows an efficient lower_bound() search for country-name+
|
|
|
|
// to check for ATNOs
|
|
|
|
std::set<QString> worked_;
|
|
|
|
};
|
2013-07-31 07:29:42 -04:00
|
|
|
|
2018-10-24 19:00:19 -04:00
|
|
|
void CountriesWorked::add (QString const& country, QString const& band)
|
2013-07-31 07:29:42 -04:00
|
|
|
{
|
2018-10-24 19:00:19 -04:00
|
|
|
m_->worked_.insert (country + '+' + band);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CountriesWorked::contains (QString const& country, QString const& band) const
|
2013-07-31 07:29:42 -04:00
|
|
|
{
|
2018-10-24 19:00:19 -04:00
|
|
|
return m_->worked_.end () != m_->worked_.lower_bound (country + '+' + band);
|
2013-07-31 07:29:42 -04:00
|
|
|
}
|