Kea  1.5.0
isc::dhcp::CfgSharedNetworks< SharedNetworkPtrType, SharedNetworkCollection > Class Template Reference

This class holds configuration of shared networks. More...

#include <cfg_shared_networks.h>

+ Inheritance diagram for isc::dhcp::CfgSharedNetworks< SharedNetworkPtrType, SharedNetworkCollection >:

Public Member Functions

void add (const SharedNetworkPtrType &network)
 Adds new shared network to the configuration. More...
 
void del (const std::string &name)
 Deletes shared network from the configuration. More...
 
SharedNetworkPtrType getByName (const std::string &name) const
 Retrieves shared network by name. More...
 
virtual data::ElementPtr toElement () const
 Unparses shared networks configuration. More...
 
- Public Member Functions inherited from isc::data::CfgToElement
virtual ~CfgToElement ()
 Destructor. More...
 

Protected Attributes

SharedNetworkCollection networks_
 Multi index container holding shared networks. More...
 

Detailed Description

template<typename SharedNetworkPtrType, typename SharedNetworkCollection>
class isc::dhcp::CfgSharedNetworks< SharedNetworkPtrType, SharedNetworkCollection >

This class holds configuration of shared networks.

This is a generic class implementing basic functions such as shared network addition, removal and retrieval. It also dumps configuration in the JSON format.

There are specializations of this class implemented as CfgSharedNetworks4 and CfgSharedNetworks6 for IPv4 and IPv6 cases repspectively.

Template Parameters
Typeof the pointer to a shared network, i.e. SharedNetwork4Ptr or SharedNetwork6Ptr.

Definition at line 34 of file cfg_shared_networks.h.

Member Function Documentation

◆ add()

template<typename SharedNetworkPtrType , typename SharedNetworkCollection >
void isc::dhcp::CfgSharedNetworks< SharedNetworkPtrType, SharedNetworkCollection >::add ( const SharedNetworkPtrType &  network)
inline

Adds new shared network to the configuration.

Parameters
networkPointer to a network
Exceptions
isc::BadValuewhen name is a duplicate of existing network's name.

Definition at line 43 of file cfg_shared_networks.h.

◆ del()

template<typename SharedNetworkPtrType , typename SharedNetworkCollection >
void isc::dhcp::CfgSharedNetworks< SharedNetworkPtrType, SharedNetworkCollection >::del ( const std::string &  name)
inline

Deletes shared network from the configuration.

Parameters
nameName of the network to be deleted.
Exceptions
isc::BadValueif the network can't be found.

Definition at line 57 of file cfg_shared_networks.h.

◆ getByName()

template<typename SharedNetworkPtrType , typename SharedNetworkCollection >
SharedNetworkPtrType isc::dhcp::CfgSharedNetworks< SharedNetworkPtrType, SharedNetworkCollection >::getByName ( const std::string &  name) const
inline

Retrieves shared network by name.

Parameters
nameName of the network to be retrieved.
Returns
Pointer to the shared network or null pointer if the network is not found.

Definition at line 78 of file cfg_shared_networks.h.

Referenced by isc::dhcp::CfgSharedNetworks< SharedNetwork6Ptr, SharedNetwork6Collection >::add().

◆ toElement()

template<typename SharedNetworkPtrType , typename SharedNetworkCollection >
virtual data::ElementPtr isc::dhcp::CfgSharedNetworks< SharedNetworkPtrType, SharedNetworkCollection >::toElement ( ) const
inlinevirtual

Unparses shared networks configuration.

Returns
Element object representing a list of shared networks held within configuration. The networks are sorted by their names.

Implements isc::data::CfgToElement.

Definition at line 91 of file cfg_shared_networks.h.

Member Data Documentation

◆ networks_

template<typename SharedNetworkPtrType , typename SharedNetworkCollection >
SharedNetworkCollection isc::dhcp::CfgSharedNetworks< SharedNetworkPtrType, SharedNetworkCollection >::networks_
protected

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