Kea 2.5.6
isc::dhcp::ClientClasses Class Reference

Container for storing client class names. More...

#include <classify.h>

Public Types

typedef ClientClassContainer::const_iterator const_iterator
 Type of iterators.
typedef ClientClassContainer::iterator iterator

Public Member Functions

 ClientClasses ()
 Default constructor.
 ClientClasses (const std::string &class_names)
 Constructor from comma separated values.
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.
void erase (const ClientClass &class_name)
 Erase element by name.
void insert (const ClientClass &class_name)
 Insert an element.
size_t size () const
 Returns the number of classes.
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 ()

Detailed Description

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 108 of file classify.h.

Member Typedef Documentation

◆ const_iterator

typedef ClientClassContainer::const_iterator isc::dhcp::ClientClasses::const_iterator

Type of iterators.

Definition at line 112 of file classify.h.

◆ iterator

typedef ClientClassContainer::iterator isc::dhcp::ClientClasses::iterator

Definition at line 113 of file classify.h.

Constructor & Destructor Documentation

◆ ClientClasses() [1/2]

isc::dhcp::ClientClasses::ClientClasses ( )

Default constructor.

Definition at line 116 of file classify.h.

◆ ClientClasses() [2/2]

isc::dhcp::ClientClasses::ClientClasses ( const std::string &  class_names)

Constructor from comma separated values.

class_namesA string containing a client classes separated with commas. The class names are trimmed before insertion to the set.

Definition at line 25 of file

References insert(), and isc::util::str::trim().

+ Here is the call graph for this function:

Member Function Documentation

◆ begin() [1/2]

iterator isc::dhcp::ClientClasses::begin ( )

Definition at line 158 of file classify.h.

◆ begin() [2/2]

const_iterator isc::dhcp::ClientClasses::begin ( ) const

Definition at line 155 of file classify.h.

◆ cbegin()

const_iterator isc::dhcp::ClientClasses::cbegin ( ) const

Iterators to the first element.

Definition at line 152 of file classify.h.

◆ cend()

const_iterator isc::dhcp::ClientClasses::cend ( ) const

Iterators to the past the end element.

Definition at line 165 of file classify.h.

◆ clear()

void isc::dhcp::ClientClasses::clear ( )

Clears containers.

Definition at line 183 of file classify.h.

◆ contains()

bool isc::dhcp::ClientClasses::contains ( const ClientClass x) const

returns if class x belongs to the defined classes

xclient class to be checked
true if x belongs to the classes

Definition at line 49 of file

Referenced by isc::dhcp::Pkt::addClass(), isc::dhcp::Pkt::addSubClass(), isc::dhcp::Pool::clientSupported(), isc::dhcp::Network::clientSupported(), isc::dhcp::Pkt::inClass(), isc::dhcp::Pool::requireClientClass(), and isc::dhcp::Network::requireClientClass().

◆ empty()

◆ end() [1/2]

iterator isc::dhcp::ClientClasses::end ( )

Definition at line 171 of file classify.h.

◆ end() [2/2]

const_iterator isc::dhcp::ClientClasses::end ( ) const

Definition at line 168 of file classify.h.

◆ erase()

void isc::dhcp::ClientClasses::erase ( const ClientClass class_name)

Erase element by name.

class_nameThe name of the class to erase.

Definition at line 40 of file

◆ insert()

void isc::dhcp::ClientClasses::insert ( const ClientClass class_name)

◆ size()

size_t isc::dhcp::ClientClasses::size ( ) const

Returns the number of classes.

; in C++ 11 list size complexity is constant so there is no advantage to use the set part.

Definition at line 146 of file classify.h.

◆ toElement()

ElementPtr isc::dhcp::ClientClasses::toElement ( ) const

Returns all class names as an ElementPtr of type ListElement.

the list

Definition at line 70 of file

References isc::data::Element::create(), and isc::data::Element::createList().

+ Here is the call graph for this function:

◆ toText()

std::string isc::dhcp::ClientClasses::toText ( const std::string &  separator = ", ") const

Returns all class names as text.

separatorSeparator to be used between class names. The default separator comprises comma sign followed by space character.
the string representation of all classes

Definition at line 55 of file

Referenced by isc::dhcp::Dhcpv4Exchange::Dhcpv4Exchange(), and isc::dhcp::Dhcpv6Srv::initContext().

The documentation for this class was generated from the following files: