16 #include <boost/bind.hpp> 24 RRsetCollection::loaderCallback(
const std::string&,
size_t,
const std::string&)
31 const CollectionKey key(rrset->getClass(), rrset->getType(),
33 CollectionMap::const_iterator it = rrsets_.find(key);
34 if (it != rrsets_.end()) {
36 "RRset for " << rrset->getName() <<
"/" << rrset->getClass()
37 <<
" with type " << rrset->getType() <<
" already exists");
40 rrsets_.insert(std::pair<CollectionKey, RRsetPtr>(key, rrset));
45 RRsetCollection::constructHelper(T source,
const isc::dns::Name& origin,
50 (boost::bind(&RRsetCollection::loaderCallback,
this, _1, _2, _3),
51 boost::bind(&RRsetCollection::loaderCallback,
this, _1, _2, _3));
53 collator.getCallback(),
62 constructHelper(filename, origin, rrclass);
68 constructHelper<std::istream&>(input_stream, origin, rrclass);
74 const CollectionKey key(rrclass, rrtype, name);
75 CollectionMap::iterator it = rrsets_.find(key);
76 if (it != rrsets_.end()) {
84 const RRType& rrtype)
const 86 const CollectionKey key(rrclass, rrtype, name);
87 CollectionMap::const_iterator it = rrsets_.find(key);
88 if (it != rrsets_.end()) {
98 const CollectionKey key(rrclass, rrtype, name);
100 CollectionMap::iterator it = rrsets_.find(key);
101 if (it == rrsets_.end()) {
111 CollectionMap::iterator it = rrsets_.begin();
117 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.
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.
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.