13 #include <boost/pointer_cast.hpp>
27 "argument is not a list Element");
29 for (
size_t i = 0; i < list->size(); ++i) {
33 "null pointer from the list at " << i);
37 "not a map from the list at " << i);
39 if (item->size() != 2) {
41 "bad map size from the list at " << i);
46 "no id from a map at " << i);
50 "not integer id from a map at " <<i);
56 "no reservations for subnet ID " << subnet_id);
58 map_.insert(std::make_pair(subnet_id,
59 boost::const_pointer_cast<Element>(resvs)));
65 for (CfgHostsMap::const_iterator item = map_.begin();
66 item != map_.end(); ++item) {
69 pair->set(
"reservations", item->second);
76 CfgHostsMap::iterator item = map_.find(
id);
77 if (item != map_.end()) {
78 item->second->add(resv);
82 map_.insert(std::make_pair(
id, resvs));
87 CfgHostsMap::const_iterator item = map_.find(
id);
88 if (item != map_.end()) {
89 return (item->second);
boost::shared_ptr< Element > ElementPtr
static ElementPtr createMap(const Position &pos=ZERO_POSITION())
Creates an empty MapElement type ElementPtr.
static ElementPtr createList(const Position &pos=ZERO_POSITION())
Creates an empty ListElement type ElementPtr.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
boost::shared_ptr< const Element > ConstElementPtr
Defines the logger used by the top-level component of kea-dhcp-ddns.
static ElementPtr create(const Position &pos=ZERO_POSITION())
uint32_t SubnetID
Unique identifier for a subnet (both v4 and v6)