Kea  2.1.7-git
isc::dhcp::CfgHostsList Class Reference

Utility class to represent host reservation configurations internally as a map keyed by subnet IDs, externally as a list Element. More...

#include <cfg_hosts_util.h>

Public Types

typedef std::map< SubnetID, isc::data::ElementPtrCfgHostsMap
 The type of the internal map. More...
 

Public Member Functions

void add (SubnetID id, isc::data::ElementPtr resv)
 Add a host reservation to the map. More...
 
isc::data::ElementPtr externalize () const
 Externalize the map to a list Element. More...
 
isc::data::ConstElementPtr get (SubnetID id) const
 Return the host reservations for a subnet ID. More...
 
void internalize (isc::data::ConstElementPtr list)
 Internalize a list Element. More...
 

Detailed Description

Utility class to represent host reservation configurations internally as a map keyed by subnet IDs, externally as a list Element.

Definition at line 18 of file cfg_hosts_util.h.

Member Typedef Documentation

◆ CfgHostsMap

The type of the internal map.

Definition at line 22 of file cfg_hosts_util.h.

Member Function Documentation

◆ add()

void isc::dhcp::CfgHostsList::add ( SubnetID  id,
isc::data::ElementPtr  resv 
)

Add a host reservation to the map.

Definition at line 75 of file cfg_hosts_util.cc.

References isc::data::Element::createList().

Referenced by isc::dhcp::CfgHosts::toElement().

+ Here is the call graph for this function:

◆ externalize()

ElementPtr isc::dhcp::CfgHostsList::externalize ( ) const

Externalize the map to a list Element.

Returns
a list Element representing all host reservations

Definition at line 63 of file cfg_hosts_util.cc.

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

Referenced by isc::dhcp::CfgHosts::toElement().

+ Here is the call graph for this function:

◆ get()

ConstElementPtr isc::dhcp::CfgHostsList::get ( SubnetID  id) const

Return the host reservations for a subnet ID.

Parameters
idthe subnet ID
Returns
a list Element with host reservations

Definition at line 86 of file cfg_hosts_util.cc.

References isc::data::Element::createList().

Referenced by isc::dhcp::CfgHosts::toElement(), and isc::dhcp::SrvConfig::toElement().

+ Here is the call graph for this function:

◆ internalize()

void isc::dhcp::CfgHostsList::internalize ( isc::data::ConstElementPtr  list)

Internalize a list Element.

This method gets a list Element and builds the internal map from it.

Parameters
listthe list Element

Definition at line 20 of file cfg_hosts_util.cc.

References isc::data::Element::integer, isc_throw, isc::data::Element::list, and isc::data::Element::map.

Referenced by isc::dhcp::SrvConfig::toElement().


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