Browse Source

[2207] The parameter of local writer is Local as well

But the benefit of this change is questionable.
Michal 'vorner' Vaner 12 years ago
parent
commit
4601f7ef87

+ 2 - 2
src/lib/datasrc/memory/zone_writer_local.cc

@@ -14,7 +14,7 @@
 
 #include "zone_writer_local.h"
 #include "zone_data.h"
-#include "zone_table_segment.h"
+#include "zone_table_segment_local.h"
 
 #include <memory>
 
@@ -24,7 +24,7 @@ namespace isc {
 namespace datasrc {
 namespace memory {
 
-ZoneWriterLocal::ZoneWriterLocal(ZoneTableSegment* segment,
+ZoneWriterLocal::ZoneWriterLocal(ZoneTableSegmentLocal* segment,
                                  const LoadAction& load_action,
                                  const dns::Name& origin,
                                  const dns::RRClass& rrclass) :

+ 5 - 4
src/lib/datasrc/memory/zone_writer_local.h

@@ -25,7 +25,7 @@ namespace datasrc {
 namespace memory {
 
 class ZoneData;
-class ZoneTableSegment;
+class ZoneTableSegmentLocal;
 
 /// \brief Writer implementation which loads data locally.
 ///
@@ -41,8 +41,9 @@ public:
     /// \param load_action The callback used to load data.
     /// \param install_action The callback used to install the loaded zone.
     /// \param rrclass The class of the zone.
-    ZoneWriterLocal(ZoneTableSegment* segment, const LoadAction& load_action,
-                    const dns::Name& name, const dns::RRClass& rrclass);
+    ZoneWriterLocal(ZoneTableSegmentLocal* segment,
+                    const LoadAction& load_action, const dns::Name& name,
+                    const dns::RRClass& rrclass);
 
     /// \brief Destructor
     ~ZoneWriterLocal();
@@ -73,7 +74,7 @@ public:
     /// the old zone replaced by install().
     virtual void cleanup();
 private:
-    ZoneTableSegment* segment_;
+    ZoneTableSegmentLocal* segment_;
     LoadAction load_action_;
     dns::Name origin_;
     dns::RRClass rrclass_;

+ 5 - 5
src/lib/datasrc/tests/memory/zone_writer_unittest.cc

@@ -13,7 +13,7 @@
 // PERFORMANCE OF THIS SOFTWARE.
 
 #include <datasrc/memory/zone_writer_local.h>
-#include <datasrc/memory/zone_table_segment.h>
+#include <datasrc/memory/zone_table_segment_local.h>
 #include <datasrc/memory/zone_data.h>
 
 #include <cc/data.h>
@@ -43,10 +43,10 @@ public:
         // (which is currently ignored)
         segment_(ZoneTableSegment::create(isc::data::NullElement())),
         writer_(new
-            ZoneWriterLocal(segment_.get(),
-                              bind(&ZoneWriterLocalTest::loadAction, this,
-                                   _1),
-                              Name("example.org"), RRClass::IN())),
+            ZoneWriterLocal(dynamic_cast<ZoneTableSegmentLocal*>(segment_.
+                                                                 get()),
+                            bind(&ZoneWriterLocalTest::loadAction, this, _1),
+                            Name("example.org"), RRClass::IN())),
         load_called_(false),
         load_throw_(false),
         load_null_(false)