13 #include <unordered_set>
62 void insert(
const ClientClass& class_name) {
63 list_.push_back(class_name);
64 set_.insert(class_name);
70 void erase(
const ClientClass& class_name);
74 return (list_.empty());
82 return (list_.size());
87 return (list_.cbegin());
91 const_iterator
cend()
const {
92 return (list_.cend());
100 return (set_.count(x) != 0);
114 std::string
toText(
const std::string& separator =
", ")
const;
118 std::list<ClientClass> list_;
121 std::unordered_set<ClientClass> set_;
std::list< ClientClass >::const_iterator const_iterator
Type of iterators.
bool contains(const ClientClass &x) const
returns if class x belongs to the defined classes
const_iterator cend() const
Iterator to the past the end element.
void clear()
Clears containers.
size_t size() const
Returns the number of classes.
Defines the logger used by the top-level component of kea-dhcp-ddns.
ClientClasses()
Default constructor.
void erase(const ClientClass &class_name)
Erase element by name.
void insert(const ClientClass &class_name)
Insert an element.
std::string ClientClass
Defines a single class name.
bool empty() const
Check if classes is empty.
const_iterator cbegin() const
Iterator to the first element.
Container for storing client class names.
std::string toText(const std::string &separator=", ") const
Returns all class names as text.