Browse Source

[1608] setup: define In-memory local finder context.
at this moment, everything is inheritated from the base class.

JINMEI Tatuya 13 years ago
parent
commit
1030e67519
2 changed files with 25 additions and 5 deletions
  1. 19 5
      src/lib/datasrc/memory_datasrc.cc
  2. 6 0
      src/lib/datasrc/memory_datasrc.h

+ 19 - 5
src/lib/datasrc/memory_datasrc.cc

@@ -106,6 +106,20 @@ struct ZoneData {
 };
 }
 
+class InMemoryZoneFinder::Context_ : public ZoneFinder::Context {
+public:
+    Context_(ZoneFinder& finder, ZoneFinder::FindOptions options,
+             const ZoneFinder::ResultContext& result) :
+        ZoneFinder::Context(finder, options, result)
+    {}
+
+    Context_(ZoneFinder& finder, ZoneFinder::FindOptions options,
+             const ZoneFinder::ResultContext& result,
+             const vector<ConstRRsetPtr> &all_set) :
+        ZoneFinder::Context(finder, options, result, all_set)
+    {}
+};
+
 // Private data and hidden methods of InMemoryZoneFinder
 struct InMemoryZoneFinder::InMemoryZoneFinderImpl {
     // Constructor
@@ -890,8 +904,8 @@ InMemoryZoneFinder::find(const Name& name, const RRType& type,
                          const FindOptions options)
 {
     return (ZoneFinderContextPtr(
-                new Context(*this, options,
-                            impl_->find(name, type, NULL, options))));
+                new Context_(*this, options, impl_->find(name, type, NULL,
+                                                         options))));
 }
 
 ZoneFinderContextPtr
@@ -900,9 +914,9 @@ InMemoryZoneFinder::findAll(const Name& name,
                             const FindOptions options)
 {
     return (ZoneFinderContextPtr(
-                new Context(*this, options, impl_->find(name, RRType::ANY(),
-                                                        &target, options),
-                            target)));
+                new Context_(*this, options, impl_->find(name, RRType::ANY(),
+                                                         &target, options),
+                             target)));
 }
 
 ZoneFinder::FindNSEC3Result

+ 6 - 0
src/lib/datasrc/memory_datasrc.h

@@ -218,6 +218,12 @@ private:
     // extracts the pointer to data and puts it into the iterator.
     // The access is read only.
     friend class InMemoryClient;
+
+    /// \brief In-memory version of finder context.
+    ///
+    /// The implementation (and any specialized interface) is completely local
+    /// to the InMemoryZoneFinder class, so it's defined as private
+    class Context_;
 };
 
 /// \brief A data source client that holds all necessary data in memory.