19 namespace ph = std::placeholders;
25 RRsetCollection::loaderCallback(
const std::string&,
size_t,
const std::string&)
32 const CollectionKey key(rrset->getClass(), rrset->getType(),
34 CollectionMap::const_iterator it = rrsets_.find(key);
35 if (it != rrsets_.end()) {
37 "RRset for " << rrset->getName() <<
"/" << rrset->getClass()
38 <<
" with type " << rrset->getType() <<
" already exists");
41 rrsets_.insert(std::pair<CollectionKey, RRsetPtr>(key, rrset));
46 RRsetCollection::constructHelper(T source,
const isc::dns::Name& origin,
51 (std::bind(&RRsetCollection::loaderCallback,
this, ph::_1, ph::_2, ph::_3),
52 std::bind(&RRsetCollection::loaderCallback,
this, ph::_1, ph::_2, ph::_3));
54 collator.getCallback(),
63 constructHelper(filename, origin, rrclass);
69 constructHelper<std::istream&>(input_stream, origin, rrclass);
75 const CollectionKey key(rrclass, rrtype, name);
76 CollectionMap::iterator it = rrsets_.find(key);
77 if (it != rrsets_.end()) {
85 const RRType& rrtype)
const
87 const CollectionKey key(rrclass, rrtype, name);
88 CollectionMap::const_iterator it = rrsets_.find(key);
89 if (it != rrsets_.end()) {
99 const CollectionKey key(rrclass, rrtype, name);
101 CollectionMap::iterator it = rrsets_.find(key);
102 if (it == rrsets_.end()) {
112 CollectionMap::iterator it = rrsets_.begin();
118 CollectionMap::iterator it = rrsets_.end();
The Name class encapsulates DNS names.
boost::shared_ptr< Iter > IterPtr
Wraps Iter with a reference count.
A generic exception that is thrown if a parameter given to a method or function is considered invalid...
A class able to load DNS master files.
virtual isc::dns::ConstRRsetPtr find(const isc::dns::Name &name, const isc::dns::RRClass &rrclass, const isc::dns::RRType &rrtype) const
Find a matching RRset in the collection.
A converter from a stream of RRs to a stream of collated RRsets.
bool removeRRset(const isc::dns::Name &name, const isc::dns::RRClass &rrclass, const isc::dns::RRType &rrtype)
Remove an RRset from the collection.
The RRClass class encapsulates DNS resource record classes.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
virtual RRsetCollectionBase::IterPtr getBeginning()
Returns an IterPtr wrapping an Iter pointing to the beginning of the collection.
void addRRset(isc::dns::RRsetPtr rrset)
Add an RRset to the collection.
Defines the logger used by the top-level component of kea-dhcp-ddns.
RRsetCollection()
Constructor.
virtual RRsetCollectionBase::IterPtr getEnd()
Returns an IterPtr wrapping an Iter pointing past the end of the collection.
The RRType class encapsulates DNS resource record types.
boost::shared_ptr< const AbstractRRset > ConstRRsetPtr
A pointer-like type pointing to an (immutable) RRset object.
boost::shared_ptr< AbstractRRset > RRsetPtr
A pointer-like type pointing to an RRset object.
void load()
Load everything.
Set of issue callbacks for a loader.