![]() |
Kea
1.5.0
|
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. More... | |
Public Member Functions | |
| void | addItem (const ItemType &item, const Selector &option_space) |
| Adds a new item to the option_space. More... | |
| void | clearItems () |
| Remove all items from the container. More... | |
| bool | empty () const |
| Indicates the container is empty. More... | |
| bool | equals (const OptionSpaceContainer &other) const |
| Check if two containers are equal. More... | |
| ItemsContainerPtr | getItems (const Selector &option_space) const |
| Get all items for the particular option space. More... | |
| std::list< Selector > | getOptionSpaceNames () const |
| Get a list of existing option spaces. More... | |
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 28 of file option_space_container.h.
| typedef boost::shared_ptr<ContainerType> isc::dhcp::OptionSpaceContainer< ContainerType, ItemType, Selector >::ItemsContainerPtr |
Pointer to the container.
Definition at line 32 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 45 of file option_space_container.h.
Referenced by isc::dhcp::bench::GenericHostDataSourceBenchmark::addTestOptions(), and isc::dhcp::LibDHCP::setRuntimeOptionDefs().
|
inline |
Remove all items from the container.
Definition at line 87 of file option_space_container.h.
Referenced by isc::dhcp::CfgOptionDef::copyTo(), and isc::dhcp::CfgOption::copyTo().
|
inline |
Indicates the container is empty.
Definition at line 37 of file option_space_container.h.
|
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 100 of file option_space_container.h.
|
inline |
Get all items for the particular option space.
| option_space | name or vendor-id of the option space. |
Definition at line 60 of file option_space_container.h.
Referenced by isc::dhcp::OptionSpaceContainer< OptionContainer, OptionDescriptor, std::string >::addItem(), and isc::dhcp::LibDHCP::setRuntimeOptionDefs().
|
inline |
Get a list of existing option spaces.
Definition at line 76 of file option_space_container.h.
Referenced by isc::dhcp::CfgOptionDef::equals(), isc::dhcp::CfgOption::getOptionSpaceNames(), isc::dhcp::CfgOption::getVendorIds(), and isc::dhcp::LibDHCP::setRuntimeOptionDefs().