]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2207] The parameter of local writer is Local as well
authorMichal 'vorner' Vaner <michal.vaner@nic.cz>
Wed, 17 Oct 2012 10:49:49 +0000 (12:49 +0200)
committerMichal 'vorner' Vaner <michal.vaner@nic.cz>
Wed, 17 Oct 2012 10:49:49 +0000 (12:49 +0200)
But the benefit of this change is questionable.

src/lib/datasrc/memory/zone_writer_local.cc
src/lib/datasrc/memory/zone_writer_local.h
src/lib/datasrc/tests/memory/zone_writer_unittest.cc

index f8e68c8f61aa7b6059889509fc5b21703fe9a445..0bccdc1560a92bbd39e479f3403cbcca41469748 100644 (file)
@@ -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) :
index a670c1fbea7e962b912b4a9287a26ae8e9da2aec..c0f51ed0453e6f31415ebf45eff7f2cd04547e03 100644 (file)
@@ -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_;
index 71bf185aa9f8f2ba0463747f7a93784b810a05d0..dea093b8e39ca8709954efb3070ed7cf23b88e79 100644 (file)
@@ -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)