Commit df5cb12f authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

[2435] Make ZoneUpdater return a isc::dns::RRsetCollectionBase reference

parent 72383e89
......@@ -1439,7 +1439,7 @@ public:
virtual ZoneFinder& getFinder() { return (*finder_); }
virtual isc::datasrc::RRsetCollectionBase& getRRsetCollection() {
virtual isc::dns::RRsetCollectionBase& getRRsetCollection() {
if (!rrset_collection_) {
// This is only assigned the first time and remains for the
// lifetime of the DatabaseUpdater.
......
......@@ -22,9 +22,6 @@
namespace isc {
namespace datasrc {
/// \brief A forward declaration
class ZoneUpdater;
/// \brief datasrc derivation of \c isc::dns::RRsetCollectionBase.
///
/// This is a default datasrc implementation of
......
......@@ -4244,7 +4244,7 @@ public:
{}
ZoneUpdaterPtr updater;
isc::datasrc::RRsetCollectionBase& collection;
isc::dns::RRsetCollectionBase& collection;
};
TYPED_TEST(RRsetCollectionTest, find) {
......@@ -4429,7 +4429,7 @@ TYPED_TEST(RRsetCollectionAndUpdaterTest, updateThrows) {
// Test that using an RRsetCollection after calling commit() on the
// ZoneUpdater throws, as the RRsetCollection is disabled.
TYPED_TEST(RRsetCollectionAndUpdaterTest, useAfterCommitThrows) {
isc::datasrc::RRsetCollectionBase& collection =
isc::dns::RRsetCollectionBase& collection =
this->updater_->getRRsetCollection();
// find() must not throw here.
......
......@@ -65,7 +65,7 @@ public:
virtual ZoneFinder& getFinder() {
isc_throw(isc::NotImplemented, "Not to be called in this test");
}
virtual isc::datasrc::RRsetCollectionBase& getRRsetCollection() {
virtual isc::dns::RRsetCollectionBase& getRRsetCollection() {
isc_throw(isc::NotImplemented, "Not to be called in this test");
}
virtual void deleteRRset(const isc::dns::AbstractRRset&) {
......
......@@ -14,6 +14,7 @@
#include <datasrc/zone_loader.h>
#include <datasrc/data_source.h>
#include <datasrc/rrset_collection_base.h>
#include <datasrc/memory/zone_table_segment.h>
#include <datasrc/memory/memory_client.h>
......@@ -77,24 +78,16 @@ public:
RRClass rrclass_;
};
// Test implementation of RRsetCollectionBase.
// Test implementation of RRsetCollectionBase. This is currently just a
// wrapper around \c isc::datasrc::RRsetCollectionBase;
// \c isc::datasrc::RRsetCollectionBase may become an abstract class in
// the future.
class TestRRsetCollection : public isc::datasrc::RRsetCollectionBase {
public:
TestRRsetCollection(ZoneUpdater& updater,
const isc::dns::RRClass& rrclass) :
isc::datasrc::RRsetCollectionBase(updater, rrclass)
{}
virtual ~TestRRsetCollection() {}
protected:
virtual RRsetCollectionBase::IterPtr getBeginning() {
isc_throw(isc::NotImplemented, "This method is not implemented.");
}
virtual RRsetCollectionBase::IterPtr getEnd() {
isc_throw(isc::NotImplemented, "This method is not implemented.");
}
};
// The updater isn't really correct according to the API. For example,
......@@ -111,7 +104,7 @@ public:
virtual ZoneFinder& getFinder() {
return (finder_);
}
virtual isc::datasrc::RRsetCollectionBase& getRRsetCollection() {
virtual isc::dns::RRsetCollectionBase& getRRsetCollection() {
if (!rrset_collection_) {
rrset_collection_.reset(new TestRRsetCollection(*this,
client_->rrclass_));
......
......@@ -21,7 +21,7 @@
#include <datasrc/exceptions.h>
#include <datasrc/result.h>
#include <datasrc/rrset_collection_base.h>
#include <dns/rrset_collection_base.h>
#include <utility>
#include <vector>
......@@ -741,9 +741,6 @@ typedef boost::shared_ptr<ZoneFinder::Context> ZoneFinderContextPtr;
/// \c ZoneFinder::Context object.
typedef boost::shared_ptr<ZoneFinder::Context> ConstZoneFinderContextPtr;
/// \brief A forward declaration
class RRsetCollectionBase;
/// The base class to make updates to a single zone.
///
/// On construction, each derived class object will start a "transaction"
......@@ -863,7 +860,7 @@ public:
/// If an \c RRsetCollection is disabled, using methods such as \c find()
/// and using its iterator would cause an exception to be thrown. See
/// \c isc::datasrc::RRsetCollectionBase for details.
virtual isc::datasrc::RRsetCollectionBase& getRRsetCollection() = 0;
virtual isc::dns::RRsetCollectionBase& getRRsetCollection() = 0;
/// Add an RRset to a zone via the updater
///
......
......@@ -20,12 +20,12 @@
#include <datasrc/iterator.h>
#include <datasrc/zone.h>
#include <datasrc/logger.h>
#include <datasrc/rrset_collection_base.h>
#include <dns/rrset.h>
#include <dns/zone_checker.h>
#include <dns/name.h>
#include <dns/rrclass.h>
#include <dns/rrset_collection_base.h>
#include <boost/bind.hpp>
......@@ -33,6 +33,7 @@
using isc::dns::Name;
using isc::dns::ConstRRsetPtr;
using isc::dns::RRsetCollectionBase;
using isc::dns::MasterLoader;
namespace isc {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment