Utils/Console: Fix rename Target::clear() to Target::flush() to fix name clash (Targe...
g0dil [Tue, 3 Feb 2009 12:07:30 +0000 (12:07 +0000)]
git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1096 270642c3-0616-0410-b53a-bc976706d245

Utils/Logger/Target.cc
Utils/Logger/Target.cci
Utils/Logger/Target.hh
Utils/Logger/Target.test.cc

index 75927e2..068631c 100644 (file)
@@ -112,7 +112,7 @@ prefix_ void senf::log::Target::unroute(int index)
         updateRoutingCache(entry.stream_, entry.area_);
 }
 
-prefix_ void senf::log::Target::clear()
+prefix_ void senf::log::Target::flush()
 {
     RIB old;
     rib_.swap(old);
index 014f64c..10e58ab 100644 (file)
@@ -88,6 +88,7 @@ prefix_ senf::log::Target::RoutingEntry::RoutingEntry()
 {}
 
 prefix_ bool senf::log::Target::RoutingEntry::operator==(RoutingEntry const & other)
+    const
 { 
     return 
         stream_ == other.stream_ && 
index 502bae8..9065ef4 100644 (file)
@@ -160,7 +160,7 @@ namespace log {
 #           endif
 
             RoutingEntry();
-            bool operator==(RoutingEntry const & other);
+            bool operator==(RoutingEntry const & other) const;
 
         private:
             RoutingEntry(detail::StreamBase const * stream, detail::AreaBase const * area,
@@ -338,7 +338,7 @@ namespace log {
         size_type size() const;         ///< Number of routing table entries
         bool empty() const;             ///< \c true, if routing table empty, \c false otherwise
 
-        void clear();                   ///< Clear routing table
+        void flush();                   ///< Clear routing table
 
     private:
         void route(detail::StreamBase const * stream, detail::AreaBase const * area,
index b19f03f..090af84 100644 (file)
@@ -86,7 +86,7 @@ BOOST_AUTO_UNIT_TEST(target)
     };
 
     BOOST_CHECK_EQUAL_COLLECTIONS( i, i_end, data, data + sizeof(data)/sizeof(data[0]) );
-    BOOST_CHECK_EQUAL( *target.begin(), target[0] );
+    BOOST_CHECK( *target.begin() == target[0] );
 
     target.unroute<senf::log::Debug>();
     target.unroute<senf::log::test::myStream, senf::log::VERBOSE>();
@@ -94,11 +94,11 @@ BOOST_AUTO_UNIT_TEST(target)
     target.unroute("senf::log::test::myStream", "", senf::log::IMPORTANT::value, 
                    senf::log::Target::REJECT);
     target.unroute(1);
-    target.clear();
+    target.flush();
 
     BOOST_CHECK( target.begin() == target.end() );
     BOOST_CHECK( target.empty() );
-    BOOST_CHECK( target.size() == 0 );
+    BOOST_CHECK_EQUAL( target.size(), 0u );
 }
 
 ///////////////////////////////cc.e////////////////////////////////////////