Browse Source

[2435] Return a isc::datasrc::RRsetCollectionBase in ZoneUpdater::getRRsetCollection()

Mukund Sivaraman 12 years ago
parent
commit
568655c55d

+ 1 - 1
src/lib/datasrc/database.cc

@@ -1436,7 +1436,7 @@ public:
 
     virtual ZoneFinder& getFinder() { return (*finder_); }
 
-    virtual isc::dns::RRsetCollectionBase& getRRsetCollection() {
+    virtual isc::datasrc::RRsetCollectionBase& getRRsetCollection() {
         if (!rrset_collection_) {
             // This is only assigned the first time and remains for the
             // lifetime of the DatabaseUpdater.

+ 10 - 0
src/lib/datasrc/rrset_collection_base.h

@@ -22,6 +22,9 @@
 namespace isc {
 namespace datasrc {
 
+/// \brief A forward declaration
+class ZoneUpdater;
+
 /// \brief datasrc derivation of \c isc::dns::RRsetCollectionBase.
 ///
 /// This is an abstract class that adds datasrc related detail to
@@ -67,6 +70,13 @@ private:
     isc::dns::RRClass rrclass_;
 };
 
+/// \brief A pointer-like type pointing to an
+/// \c isc::datasrc::RRsetCollectionBase object.
+///
+/// This type is used to handle RRsetCollections in a polymorphic manner
+/// in libdatasrc.
+typedef boost::shared_ptr<isc::datasrc::RRsetCollectionBase> RRsetCollectionPtr;
+
 } // end of namespace datasrc
 } // end of namespace isc
 

+ 1 - 1
src/lib/datasrc/tests/database_unittest.cc

@@ -4172,7 +4172,7 @@ public:
     {}
 
     ZoneUpdaterPtr updater;
-    RRsetCollectionBase& collection;
+    isc::datasrc::RRsetCollectionBase& collection;
 };
 
 TYPED_TEST(RRsetCollectionTest, find) {

+ 1 - 1
src/lib/datasrc/tests/master_loader_callbacks_test.cc

@@ -65,7 +65,7 @@ public:
     virtual ZoneFinder& getFinder() {
         isc_throw(isc::NotImplemented, "Not to be called in this test");
     }
-    virtual isc::dns::RRsetCollectionBase& getRRsetCollection() {
+    virtual isc::datasrc::RRsetCollectionBase& getRRsetCollection() {
         isc_throw(isc::NotImplemented, "Not to be called in this test");
     }
     virtual void deleteRRset(const isc::dns::AbstractRRset&) {

+ 1 - 1
src/lib/datasrc/tests/zone_loader_unittest.cc

@@ -89,7 +89,7 @@ public:
     virtual ZoneFinder& getFinder() {
         return (finder_);
     }
-    virtual isc::dns::RRsetCollectionBase& getRRsetCollection() {
+    virtual isc::datasrc::RRsetCollectionBase& getRRsetCollection() {
         isc_throw(isc::NotImplemented, "Method not used in tests");
     }
     virtual void addRRset(const isc::dns::AbstractRRset& rrset) {

+ 6 - 3
src/lib/datasrc/zone.h

@@ -18,10 +18,10 @@
 #include <dns/name.h>
 #include <dns/rrset.h>
 #include <dns/rrtype.h>
-#include <dns/rrset_collection_base.h>
 
 #include <datasrc/exceptions.h>
 #include <datasrc/result.h>
+#include <datasrc/rrset_collection_base.h>
 
 #include <utility>
 #include <vector>
@@ -741,6 +741,9 @@ 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"
@@ -806,7 +809,7 @@ public:
     /// Return an RRsetCollection for the updater.
     ///
     /// This method returns an \c RRsetCollection for the updater,
-    /// implementing the \c isc::dns::RRsetCollectionBase
+    /// implementing the \c isc::datasrc::RRsetCollectionBase
     /// interface. Typically, the returned \c RRsetCollection is a
     /// singleton for its \c ZoneUpdater. The returned RRsetCollection
     /// object must not be used after its corresponding \c ZoneUpdater
@@ -819,7 +822,7 @@ public:
     /// of the \c Zonefinder returned by \c getFinder() with regards to
     /// adding and deleting RRsets via \c addRRset() and \c
     /// deleteRRset().
-    virtual isc::dns::RRsetCollectionBase& getRRsetCollection() = 0;
+    virtual isc::datasrc::RRsetCollectionBase& getRRsetCollection() = 0;
 
     /// Add an RRset to a zone via the updater
     ///

+ 0 - 6
src/lib/dns/rrset_collection_base.h

@@ -171,12 +171,6 @@ public:
     }
 };
 
-/// \brief A pointer-like type pointing to an \c RRsetCollection object.
-///
-/// This type is used to handle RRsetCollections in a polymorphic manner
-/// in the BIND 10 codebase.
-typedef boost::shared_ptr<RRsetCollectionBase> RRsetCollectionPtr;
-
 } // end of namespace dns
 } // end of namespace isc