Kea
1.9.9-git
|
Container for storing client class names. More...
#include <classify.h>
Public Types | |
typedef std::list< ClientClass >::const_iterator | const_iterator |
Type of iterators. More... | |
Public Member Functions | |
ClientClasses () | |
Default constructor. More... | |
ClientClasses (const ClientClass &class_names) | |
Constructor from comma separated values. More... | |
const_iterator | cbegin () const |
Iterator to the first element. More... | |
const_iterator | cend () const |
Iterator to the past the end element. More... | |
void | clear () |
Clears containers. More... | |
bool | contains (const ClientClass &x) const |
returns if class x belongs to the defined classes More... | |
bool | empty () const |
Check if classes is empty. More... | |
void | erase (const ClientClass &class_name) |
Erase element by name. More... | |
void | insert (const ClientClass &class_name) |
Insert an element. More... | |
size_t | size () const |
Returns the number of classes. More... | |
std::string | toText (const std::string &separator=", ") const |
Returns all class names as text. More... | |
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 43 of file classify.h.
typedef std::list<ClientClass>::const_iterator isc::dhcp::ClientClasses::const_iterator |
Type of iterators.
Definition at line 47 of file classify.h.
|
inline |
Default constructor.
Definition at line 50 of file classify.h.
isc::dhcp::ClientClasses::ClientClasses | ( | const ClientClass & | 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 19 of file classify.cc.
References insert(), and isc::util::str::trim().
|
inline |
Iterator to the first element.
Definition at line 86 of file classify.h.
Referenced by isc::dhcp::Dhcpv6Srv::buildCfgOptionList(), isc::dhcp::Dhcpv4Srv::buildCfgOptionList(), isc::dhcp::Dhcpv4Srv::deferredUnpack(), isc::dhcp::AllocEngine::getValidLft(), isc::dhcp::Dhcpv6Srv::requiredClassify(), isc::dhcp::Dhcpv4Srv::requiredClassify(), isc::dhcp::Dhcpv4Srv::setFixedFields(), isc::dhcp::Dhcpv4Exchange::setReservedClientClasses(), isc::dhcp::Dhcpv6Srv::setReservedClientClasses(), isc::dhcp::Pool::toElement(), isc::dhcp::Network::toElement(), isc::dhcp::Host::toElement4(), isc::dhcp::Host::toElement6(), toText(), and isc::dhcp::Host::toText().
|
inline |
Iterator to the past the end element.
Definition at line 91 of file classify.h.
Referenced by isc::dhcp::Dhcpv6Srv::buildCfgOptionList(), isc::dhcp::Dhcpv4Srv::buildCfgOptionList(), isc::dhcp::Dhcpv4Srv::deferredUnpack(), isc::dhcp::AllocEngine::getValidLft(), isc::dhcp::Dhcpv6Srv::requiredClassify(), isc::dhcp::Dhcpv4Srv::requiredClassify(), isc::dhcp::Dhcpv4Srv::setFixedFields(), isc::dhcp::Dhcpv4Exchange::setReservedClientClasses(), isc::dhcp::Dhcpv6Srv::setReservedClientClasses(), isc::dhcp::Pool::toElement(), isc::dhcp::Network::toElement(), isc::dhcp::Host::toElement4(), isc::dhcp::Host::toElement6(), toText(), and isc::dhcp::Host::toText().
|
inline |
Clears containers.
Definition at line 104 of file classify.h.
|
inline |
returns if class x belongs to the defined classes
x | client class to be checked |
Definition at line 99 of file classify.h.
Referenced by isc::dhcp::Pkt::addClass(), isc::dhcp::Pool::clientSupported(), isc::dhcp::Network::clientSupported(), isc::dhcp::Pkt::inClass(), and isc::dhcp::Pool::requireClientClass().
|
inline |
Check if classes is empty.
Definition at line 73 of file classify.h.
Referenced by isc::dhcp::Pkt::addClass(), isc::dhcp::Dhcpv4Exchange::Dhcpv4Exchange(), isc::dhcp::AllocEngine::getValidLft(), isc::dhcp::Dhcpv4Srv::setFixedFields(), isc::dhcp::Dhcpv6Srv::setReservedClientClasses(), isc::dhcp::Pool::toElement(), and isc::dhcp::Network::toElement().
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 34 of file classify.cc.
|
inline |
Insert an element.
class_name | The name of the class to insert |
Definition at line 62 of file classify.h.
Referenced by isc::dhcp::Pkt::addClass(), ClientClasses(), isc::dhcp::Pool::requireClientClass(), isc::dhcp::Dhcpv6Srv::requiredClassify(), and isc::dhcp::Dhcpv4Srv::requiredClassify().
|
inline |
Returns the number of classes.
Definition at line 81 of file classify.h.
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 40 of file classify.cc.
References cbegin(), and cend().
Referenced by isc::dhcp::Dhcpv4Exchange::Dhcpv4Exchange(), and isc::dhcp::Dhcpv6Srv::setReservedClientClasses().