Kea
1.9.9-git
|
Generic class to represent a set of RRsets. More...
#include <rrset_collection_base.h>
Classes | |
class | Iter |
A helper iterator interface for RRsetCollectionBase . More... | |
class | Iterator |
A forward std::iterator for RRsetCollectionBase . More... | |
Public Member Functions | |
virtual | ~RRsetCollectionBase () |
Destructor. More... | |
Iterator | begin () |
Returns an iterator pointing to the beginning of the collection. More... | |
Iterator | end () |
Returns an iterator pointing past the end of the collection. More... | |
virtual isc::dns::ConstRRsetPtr | find (const isc::dns::Name &name, const isc::dns::RRClass &rrclass, const isc::dns::RRType &rrtype) const =0 |
Find a matching RRset in the collection. More... | |
Protected Types | |
typedef boost::shared_ptr< Iter > | IterPtr |
Wraps Iter with a reference count. More... | |
Protected Member Functions | |
virtual IterPtr | getBeginning ()=0 |
Returns an IterPtr wrapping an Iter pointing to the beginning of the collection. More... | |
virtual IterPtr | getEnd ()=0 |
Returns an IterPtr wrapping an Iter pointing past the end of the collection. More... | |
Generic class to represent a set of RRsets.
This is a generic container and the stored set of RRsets does not necessarily form a valid zone (e.g. there doesn't necessarily have to be an SOA at the "origin"). Instead, it will be used to represent a single zone for the purpose of zone loading/checking. It provides a simple find() method to find an RRset for the given name and type (and maybe class) and a way to iterate over all RRsets.
See RRsetCollection
for a simple libdns++ implementation using an STL container. libdatasrc will have another implementation.
Definition at line 44 of file rrset_collection_base.h.
|
protected |
Wraps Iter with a reference count.
Definition at line 100 of file rrset_collection_base.h.
|
inlinevirtual |
Destructor.
Definition at line 97 of file rrset_collection_base.h.
|
inline |
Returns an iterator pointing to the beginning of the collection.
Definition at line 193 of file rrset_collection_base.h.
References getBeginning().
|
inline |
Returns an iterator pointing past the end of the collection.
Definition at line 199 of file rrset_collection_base.h.
References getEnd().
|
pure virtual |
Find a matching RRset in the collection.
Returns the RRset in the collection that exactly matches the given name
, rrclass
and rrtype
. If no matching RRset is found, NULL
is returned.
This method's implementations currently are not specified to handle RRTypes
such as RRSIG and NSEC3. This interface may be refined to clarify this point in the future, and perhaps, provide additional API for these RRType.
As for RRSIG, there are some fundamental open questions. For example, it's not clear whether we want to return all RRSIGs of the given name covering any RR types (in which case, we need to figure out how), or we need to extend the interface so we can specify the covered type. A specific derived implementation may return something if type RRSIG is specified, but this is not specified here at the base class level. So, for RRSIGs the behavior should be assumed as undefined.
As for NSEC3, it's not clear whether owner names (which included hashed labels) are the best choice of search key, because in many cases, what the application wants to find is an NSEC3 that has the hash of some particular "normal" domain names. Also, if the underlying implementation encapsulates a single zone, NSEC3 records conceptually belong to a separate name space, which may cause implementation difficulty.
Behavior with meta types such as ANY and AXFR are also undefined. A specific implementation may return something for these. But, unlike the case of RRSIGs, these types of RRsets are not expected to be added to any implementation of collection in the first place (by the definition of "meta types"), so querying for such types is basically an invalid operation. The API doesn't require implementations to check this condition and reject it, so the behavior is undefined. This interface will not be refined in future versions for these meta types.
RRsetCollectionError | if find() results in some implementation-specific error. |
name | The name of the RRset to search for. |
rrtype | The type of the RRset to search for. |
rrclass | The class of the RRset to search for. |
NULL
otherwise. Implemented in isc::dns::RRsetCollection.
|
protectedpure virtual |
Returns an IterPtr
wrapping an Iter pointing to the beginning of the collection.
isc::dns::RRsetCollectionError | if using the iterator results in some underlying datasrc error. |
Implemented in isc::dns::RRsetCollection.
Referenced by begin().
|
protectedpure virtual |
Returns an IterPtr
wrapping an Iter pointing past the end of the collection.
isc::dns::RRsetCollectionError | if using the iterator results in some underlying datasrc error. |
Implemented in isc::dns::RRsetCollection.
Referenced by end().