BIND 10 trac1958, updated. a14dd1bb813a03e9cedecc44b237c24fc0dbe08e [1958] Prefer const iterators and pointers where possible.

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Jul 20 19:23:29 UTC 2012


The branch, trac1958 has been updated
       via  a14dd1bb813a03e9cedecc44b237c24fc0dbe08e (commit)
      from  bd1c6a351401bbd9b88a86c6e159083e4421398b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit a14dd1bb813a03e9cedecc44b237c24fc0dbe08e
Author: Marcin Siodelski <marcin at isc.org>
Date:   Fri Jul 20 21:05:00 2012 +0200

    [1958] Prefer const iterators and pointers where possible.

-----------------------------------------------------------------------

Summary of changes:
 tests/tools/perfdhcp/stats_mgr.h |   13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

-----------------------------------------------------------------------
diff --git a/tests/tools/perfdhcp/stats_mgr.h b/tests/tools/perfdhcp/stats_mgr.h
index 3c12286..cae1029 100644
--- a/tests/tools/perfdhcp/stats_mgr.h
+++ b/tests/tools/perfdhcp/stats_mgr.h
@@ -23,7 +23,6 @@
 #include <boost/multi_index_container.hpp>
 #include <boost/multi_index/hashed_index.hpp>
 #include <boost/multi_index/sequenced_index.hpp>
-#include <boost/multi_index/mem_fun.hpp>
 #include <boost/multi_index/global_fun.hpp>
 #include <boost/date_time/posix_time/posix_time.hpp>
 
@@ -132,7 +131,7 @@ public:
     class ExchangeStats {
     public:
 
-        static uint32_t transid_hash(boost::shared_ptr<T> packet) {
+        static uint32_t transid_hash(const boost::shared_ptr<T> packet) {
             return packet->getTransid() & 1023;
         }
 
@@ -156,12 +155,12 @@ public:
         > PktList;
 
         /// Packet list iterator for sequencial access to elements.
-        typedef typename PktList::iterator PktListIterator;
+        typedef typename PktList::const_iterator PktListIterator;
         /// Packet list index to search packets using transaction id.
         typedef typename PktList::template nth_index<1>::type
             PktListTransidIndex;
         /// Packet list iterator to access packets using transaction id.
-        typedef typename PktListTransidIndex::iterator PktListTransidIterator;
+        typedef typename PktListTransidIndex::const_iterator PktListTransidIterator;
 
         /// \brief Constructor
         ///
@@ -209,8 +208,8 @@ public:
         /// \param sent_packet sent packet
         /// \param rcvd_packet received packet
         /// \throw isc::Unexpected if failed to calculate timestamps
-        void updateDelays(const boost::shared_ptr<T> sent_packet,
-                          const boost::shared_ptr<T> rcvd_packet) {
+        void updateDelays(const boost::shared_ptr<const T> sent_packet,
+                          const boost::shared_ptr<const T> rcvd_packet) {
             boost::posix_time::ptime sent_time = sent_packet->getTimestamp();
             boost::posix_time::ptime rcvd_time = rcvd_packet->getTimestamp();
 
@@ -496,7 +495,7 @@ public:
     /// Map containing custom counters.
     typedef typename std::map<std::string, CustomCounterPtr> CustomCountersMap;
     /// Iterator for \ref CustomCountersMap.
-    typedef typename CustomCountersMap::iterator CustomCountersMapIterator;
+    typedef typename CustomCountersMap::const_iterator CustomCountersMapIterator;
 
     /// \brief Constructor.
     StatsMgr()



More information about the bind10-changes mailing list