Browse Source

[1278] Interface for the finder in the iterator

Michal 'vorner' Vaner 13 years ago
parent
commit
797d30d14f
3 changed files with 17 additions and 0 deletions
  1. 4 0
      src/lib/datasrc/database.cc
  2. 9 0
      src/lib/datasrc/iterator.h
  3. 4 0
      src/lib/datasrc/memory_datasrc.cc

+ 4 - 0
src/lib/datasrc/database.cc

@@ -740,6 +740,10 @@ public:
             arg(rrset->getName()).arg(rrset->getType());
             arg(rrset->getName()).arg(rrset->getType());
         return (rrset);
         return (rrset);
     }
     }
+
+    virtual ZoneFinder& getFinder() {
+        isc_throw(NotImplemented, "Not implemented");
+    }
 private:
 private:
     // Load next row of data
     // Load next row of data
     void getData() {
     void getData() {

+ 9 - 0
src/lib/datasrc/iterator.h

@@ -16,6 +16,8 @@
 
 
 #include <boost/noncopyable.hpp>
 #include <boost/noncopyable.hpp>
 
 
+#include <datasrc/zone.h>
+
 namespace isc {
 namespace isc {
 namespace datasrc {
 namespace datasrc {
 
 
@@ -55,6 +57,13 @@ public:
      *     gets to the end of the zone.
      *     gets to the end of the zone.
      */
      */
     virtual isc::dns::ConstRRsetPtr getNextRRset() = 0;
     virtual isc::dns::ConstRRsetPtr getNextRRset() = 0;
+    /**
+     * \brief Get the finder for the zone being iterated.
+     *
+     * This returns the finder which can be used to query RRs from the zone,
+     * efective to the time when the iterator was created.
+     */
+    virtual ZoneFinder& getFinder() = 0;
 };
 };
 
 
 }
 }

+ 4 - 0
src/lib/datasrc/memory_datasrc.cc

@@ -780,6 +780,10 @@ public:
 
 
         return (result);
         return (result);
     }
     }
+
+    virtual ZoneFinder& getFinder() {
+        isc_throw(NotImplemented, "Not imelemented");
+    }
 };
 };
 
 
 } // End of anonymous namespace
 } // End of anonymous namespace