From: Michal 'vorner' Vaner Date: Wed, 17 Oct 2012 10:49:49 +0000 (+0200) Subject: [2207] The parameter of local writer is Local as well X-Git-Tag: trac2402_base~12^2~14 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4601f7ef87135a559b4fa7a1daaf2f1de8f040c3;p=thirdparty%2Fkea.git [2207] The parameter of local writer is Local as well But the benefit of this change is questionable. --- diff --git a/src/lib/datasrc/memory/zone_writer_local.cc b/src/lib/datasrc/memory/zone_writer_local.cc index f8e68c8f61..0bccdc1560 100644 --- a/src/lib/datasrc/memory/zone_writer_local.cc +++ b/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 @@ -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) : diff --git a/src/lib/datasrc/memory/zone_writer_local.h b/src/lib/datasrc/memory/zone_writer_local.h index a670c1fbea..c0f51ed045 100644 --- a/src/lib/datasrc/memory/zone_writer_local.h +++ b/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_; diff --git a/src/lib/datasrc/tests/memory/zone_writer_unittest.cc b/src/lib/datasrc/tests/memory/zone_writer_unittest.cc index 71bf185aa9..dea093b8e3 100644 --- a/src/lib/datasrc/tests/memory/zone_writer_unittest.cc +++ b/src/lib/datasrc/tests/memory/zone_writer_unittest.cc @@ -13,7 +13,7 @@ // PERFORMANCE OF THIS SOFTWARE. #include -#include +#include #include #include @@ -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(segment_. + get()), + bind(&ZoneWriterLocalTest::loadAction, this, _1), + Name("example.org"), RRClass::IN())), load_called_(false), load_throw_(false), load_null_(false)