Kea 2.7.6
|
Simple container for option spaces holding various items. More...
#include <option_space_container.h>
Public Types | |
typedef boost::shared_ptr< ContainerType > | ItemsContainerPtr |
Pointer to the container. | |
Public Member Functions | |
void | addItem (const ItemType &item, const Selector &option_space) |
Adds a new item to the option_space. | |
void | clearItems () |
Remove all items from the container. | |
uint64_t | deleteItems (const uint64_t id) |
Remove all options or option definitions with a given database identifier. | |
bool | empty () const |
Indicates the container is empty. | |
bool | equals (const OptionSpaceContainer &other) const |
Check if two containers are equal. | |
ItemsContainerPtr | getItems (const Selector &option_space) const |
Get all items for the particular option space. | |
std::list< Selector > | getOptionSpaceNames () const |
Get a list of existing option spaces. | |
Simple container for option spaces holding various items.
This helper class is used to store items of various types that are grouped by option space names. Each option space is mapped to a container that holds items which specifically can be OptionDefinition objects or Subnet::OptionDescriptor structures.
ContainerType | of the container holding items within option space. |
ItemType | type of the item being held by the container. |
Selector | a string (for option spaces) or uint32_t (for vendor options) |
Definition at line 32 of file option_space_container.h.
boost::shared_ptr<ContainerType> isc::dhcp::OptionSpaceContainer< ContainerType, ItemType, Selector >::ItemsContainerPtr |
Pointer to the container.
Definition at line 36 of file option_space_container.h.
|
inline |
Adds a new item to the option_space.
item | reference to the item being added. |
option_space | name or vendor-id of the option space |
Definition at line 49 of file option_space_container.h.
References isc::dhcp::OptionSpaceContainer< ContainerType, ItemType, Selector >::getItems().
Referenced by isc::dhcp::CfgOption::add(), and isc::dhcp::OptionDefSpaceContainer::addItem().
|
inline |
Remove all items from the container.
Definition at line 94 of file option_space_container.h.
Referenced by isc::dhcp::CfgOption::copyTo(), and isc::dhcp::CfgOptionDef::copyTo().
|
inline |
Remove all options or option definitions with a given database identifier.
Note that there are cases when there will be multiple options or option definitions having the same id (typically id of 0). When configuration backend is in use it sets the unique ids from the database. In cases when the configuration backend is not used, the ids default to 0. Passing the id of 0 would result in deleting all options or option definitions that were not added via the database.
id | Identifier of the items to be deleted. |
Definition at line 112 of file option_space_container.h.
Referenced by isc::dhcp::CfgOption::del(), and isc::dhcp::CfgOptionDef::del().
|
inline |
Indicates the container is empty.
Definition at line 41 of file option_space_container.h.
Referenced by isc::dhcp::CfgOption::empty().
|
inline |
Check if two containers are equal.
This method checks if option space container contains exactly the same selectors and that there are exactly the same items added for each selector. The order of items doesn't matter.
other | Other container to compare to. |
Definition at line 132 of file option_space_container.h.
Referenced by isc::dhcp::CfgOption::equals().
|
inline |
Get all items for the particular option space.
option_space | name or vendor-id of the option space. |
Definition at line 67 of file option_space_container.h.
Referenced by isc::dhcp::OptionSpaceContainer< ContainerType, ItemType, Selector >::addItem(), isc::dhcp::CfgOption::getAll(), isc::dhcp::CfgOption::getAll(), isc::dhcp::CfgOptionDef::getAll(), and isc::dhcp::LibDHCP::setRuntimeOptionDefs().
|
inline |
Get a list of existing option spaces.
Definition at line 83 of file option_space_container.h.
Referenced by isc::dhcp::CfgOptionDef::copyTo(), isc::dhcp::CfgOptionDef::equals(), isc::dhcp::CfgOption::getOptionSpaceNames(), isc::dhcp::CfgOption::getVendorIds(), isc::dhcp::CfgOptionDef::merge(), isc::dhcp::LibDHCP::setRuntimeOptionDefs(), isc::dhcp::CfgOption::toElementWithMetadata(), and isc::dhcp::CfgOptionDef::toElementWithMetadata().