|  | Kea 3.1.0
    | 
Container for storing client class names. More...
#include <classify.h>
| Classes | |
| struct | Hash | 
| Hash enabling use in the unordered containers.  More... | |
| Public Types | |
| typedef ClientClassContainer::const_iterator | const_iterator | 
| Type of iterators. | |
| typedef ClientClassContainer::iterator | iterator | 
| Public Member Functions | |
| ClientClasses () | |
| Default constructor. | |
| ClientClasses (const ClientClasses &other) | |
| Copy constructor. | |
| ClientClasses (const std::string &class_names) | |
| Constructor from comma separated values. | |
| virtual | ~ClientClasses () | 
| Destructor. | |
| void | clear () | 
| Clears containers. | |
| bool | contains (const ClientClass &x) const | 
| returns if class x belongs to the defined classes | |
| bool | empty () const | 
| Check if classes is empty. | |
| bool | equals (const ClientClasses &other) const | 
| Compares two ClientClasses container for equality. | |
| void | erase (const ClientClass &class_name) | 
| Erase element by name. | |
| void | fromElement (isc::data::ConstElementPtr list) | 
| Sets contents from a ListElement. | |
| void | insert (const ClientClass &class_name) | 
| Insert an element. | |
| bool | intersects (const ClientClasses &cclasses) const | 
| returns whether this container has at least one class in common with a given container. | |
| bool | operator!= (const ClientClasses &other) const | 
| Compares two ClientClasses container for inequality. | |
| ClientClasses & | operator= (const ClientClasses &other) | 
| Assigns the contents of on container to another. | |
| bool | operator== (const ClientClasses &other) const | 
| Compares two ClientClasses containers for equality. | |
| size_t | size () const | 
| Returns the number of classes. | |
| virtual isc::data::ElementPtr | toElement () const | 
| Returns all class names as an ElementPtr of type ListElement. | |
| std::string | toText (const std::string &separator=", ") const | 
| Returns all class names as text. | |
| const_iterator | cbegin () const | 
| Iterators to the first element. | |
| const_iterator | begin () const | 
| iterator | begin () | 
| const_iterator | cend () const | 
| Iterators to the past the end element. | |
| const_iterator | end () const | 
| iterator | end () | 
| Public Member Functions inherited from isc::data::CfgToElement | |
| virtual | ~CfgToElement () | 
| Destructor. | |
Container for storing client class names.
Both a list to iterate on it in insert order and unordered set of names for existence.
Definition at line 110 of file classify.h.
| typedef ClientClassContainer::const_iterator isc::dhcp::ClientClasses::const_iterator | 
Type of iterators.
Definition at line 114 of file classify.h.
| typedef ClientClassContainer::iterator isc::dhcp::ClientClasses::iterator | 
Definition at line 115 of file classify.h.
| 
 | inline | 
Default constructor.
Definition at line 118 of file classify.h.
Referenced by ClientClasses(), equals(), intersects(), operator!=(), isc::dhcp::ClientClasses::Hash::operator()(), operator=(), and operator==().
| isc::dhcp::ClientClasses::ClientClasses | ( | const std::string & | class_names | ) | 
Constructor from comma separated values.
| class_names | A string containing a client classes separated with commas. The class names are trimmed before insertion to the set. | 
Definition at line 25 of file classify.cc.
References insert(), and isc::util::str::trim().
| 
 | inlinevirtual | 
Destructor.
Definition at line 128 of file classify.h.
| isc::dhcp::ClientClasses::ClientClasses | ( | const ClientClasses & | other | ) | 
Copy constructor.
| other | ClientClasses object to be copied. | 
Definition at line 39 of file classify.cc.
References ClientClasses(), and insert().
| 
 | inline | 
Definition at line 192 of file classify.h.
| 
 | inline | 
Definition at line 188 of file classify.h.
| 
 | inline | 
| 
 | inline | 
Iterators to the past the end element.
Definition at line 199 of file classify.h.
Referenced by equals().
| 
 | inline | 
Clears containers.
Definition at line 227 of file classify.h.
Referenced by fromElement(), and operator=().
| bool isc::dhcp::ClientClasses::contains | ( | const ClientClass & | x | ) | const | 
returns if class x belongs to the defined classes
| x | client class to be checked | 
Definition at line 55 of file classify.cc.
Referenced by intersects().
| 
 | inline | 
Check if classes is empty.
Definition at line 170 of file classify.h.
Referenced by isc::dhcp::AllocEngine::getLifetimes6(), isc::dhcp::AllocEngine::getOfferLft(), isc::dhcp::AllocEngine::getValidLft(), and isc::dhcp::Dhcpv4Srv::setFixedFields().
| 
 | inline | 
Definition at line 207 of file classify.h.
| 
 | inline | 
Definition at line 203 of file classify.h.
| bool isc::dhcp::ClientClasses::equals | ( | const ClientClasses & | other | ) | const | 
Compares two ClientClasses container for equality.
Definition at line 123 of file classify.cc.
References ClientClasses(), cbegin(), cend(), and size().
Referenced by operator!=(), and operator==().
| void isc::dhcp::ClientClasses::erase | ( | const ClientClass & | class_name | ) | 
Erase element by name.
| class_name | The name of the class to erase. | 
Definition at line 46 of file classify.cc.
| void isc::dhcp::ClientClasses::fromElement | ( | isc::data::ConstElementPtr | list | ) | 
Sets contents from a ListElement.
| list | JSON list of classes from which to populate the container. | 
| BadValue | if the element is not a list or contents are invalid | 
Definition at line 104 of file classify.cc.
References clear(), insert(), isc_throw, isc::data::Element::list, and isc::data::Element::string.
Referenced by isc::dhcp::OptionDataParser::createOption().
| 
 | inline | 
Insert an element.
| class_name | The name of the class to insert | 
Definition at line 160 of file classify.h.
Referenced by ClientClasses(), ClientClasses(), isc::dhcp::Dhcpv4Srv::evaluateAdditionalClasses(), isc::dhcp::Dhcpv6Srv::evaluateAdditionalClasses(), fromElement(), and operator=().
| bool isc::dhcp::ClientClasses::intersects | ( | const ClientClasses & | cclasses | ) | const | 
returns whether this container has at least one class in common with a given container.
| cclasses | list of classes to check for intersection with | 
Definition at line 61 of file classify.cc.
References ClientClasses(), contains(), and size().
| 
 | inline | 
Compares two ClientClasses container for inequality.
Definition at line 153 of file classify.h.
References ClientClasses(), and equals().
| ClientClasses & isc::dhcp::ClientClasses::operator= | ( | const ClientClasses & | other | ) | 
Assigns the contents of on container to another.
Definition at line 128 of file classify.cc.
References ClientClasses(), clear(), and insert().
| 
 | inline | 
Compares two ClientClasses containers for equality.
Definition at line 146 of file classify.h.
References ClientClasses(), and equals().
| 
 | inline | 
Returns the number of classes.
Definition at line 178 of file classify.h.
Referenced by equals(), and intersects().
| 
 | virtual | 
Returns all class names as an ElementPtr of type ListElement.
Implements isc::data::CfgToElement.
Definition at line 95 of file classify.cc.
References isc::data::Element::create(), and isc::data::Element::createList().
| std::string isc::dhcp::ClientClasses::toText | ( | const std::string & | separator = ", " | ) | const | 
Returns all class names as text.
| separator | Separator to be used between class names. The default separator comprises comma sign followed by space character. | 
Definition at line 80 of file classify.cc.
Referenced by isc::dhcp::Dhcpv4Exchange::Dhcpv4Exchange(), isc::dhcp::hash_value(), isc::dhcp::Dhcpv6Srv::initContext(), and isc::dhcp::CfgOption::replace().