BIND 10 trac2138, updated. caa70d6b850f75119b9b8f7c71caf8e56bdc47a6 [2138] changed the return type of getStatistics to const pointer.

BIND 10 source code commits bind10-changes at lists.isc.org
Tue Aug 21 17:47:50 UTC 2012


The branch, trac2138 has been updated
       via  caa70d6b850f75119b9b8f7c71caf8e56bdc47a6 (commit)
      from  f02efa83ef95d63d9a0f82a4806b748340cf112c (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 caa70d6b850f75119b9b8f7c71caf8e56bdc47a6
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Tue Aug 21 10:47:14 2012 -0700

    [2138] changed the return type of getStatistics to const pointer.
    
    so we can consistently use const versions.

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

Summary of changes:
 src/bin/auth/auth_srv.cc   |    2 +-
 src/bin/auth/auth_srv.h    |    2 +-
 src/bin/auth/statistics.cc |   12 +++++-------
 src/bin/auth/statistics.h  |    2 +-
 4 files changed, 8 insertions(+), 10 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/bin/auth/auth_srv.cc b/src/bin/auth/auth_srv.cc
index 0f8ba00..6e5666f 100644
--- a/src/bin/auth/auth_srv.cc
+++ b/src/bin/auth/auth_srv.cc
@@ -846,7 +846,7 @@ AuthSrv::updateConfig(ConstElementPtr new_config) {
     }
 }
 
-ElementPtr AuthSrv::getStatistics() const {
+ConstElementPtr AuthSrv::getStatistics() const {
     return (impl_->counters_.getStatistics());
 }
 
diff --git a/src/bin/auth/auth_srv.h b/src/bin/auth/auth_srv.h
index 1fca8e1..2c2b415 100644
--- a/src/bin/auth/auth_srv.h
+++ b/src/bin/auth/auth_srv.h
@@ -208,7 +208,7 @@ public:
     /// AuthCounters::getStatistics().
     ///
     /// \return JSON format statistics data.
-    isc::data::ElementPtr getStatistics() const;
+    isc::data::ConstElementPtr getStatistics() const;
 
     /// \brief Get the value of counter in the AuthCounters.
     ///
diff --git a/src/bin/auth/statistics.cc b/src/bin/auth/statistics.cc
index 82d41af..2d5f336 100644
--- a/src/bin/auth/statistics.cc
+++ b/src/bin/auth/statistics.cc
@@ -55,7 +55,7 @@ public:
     }
     void inc(const std::string& zone,
              const AuthCounters::PerZoneCounterType type);
-    isc::data::ElementPtr getStatistics() const;
+    isc::data::ConstElementPtr getStatistics() const;
     void registerStatisticsValidator
     (AuthCounters::validator_type validator);
     // Currently for testing purpose only
@@ -102,7 +102,7 @@ AuthCountersImpl::inc(const std::string& zone,
     per_zone_counter_[zone].inc(type);
 }
 
-isc::data::ElementPtr
+isc::data::ConstElementPtr
 AuthCountersImpl::getStatistics() const {
     std::stringstream statistics_string;
     statistics_string << "{ \"queries.udp\": "
@@ -137,13 +137,11 @@ AuthCountersImpl::getStatistics() const {
     }
     statistics_string << "}";
 
-    isc::data::ElementPtr statistics_element =
+    isc::data::ConstElementPtr statistics_element =
         isc::data::Element::fromJSON(statistics_string);
     // validate the statistics data before send
     if (validator_) {
-        if (!validator_(
-                 static_cast<isc::data::ConstElementPtr>(statistics_element)))
-        {
+        if (!validator_(statistics_element)) {
             LOG_ERROR(auth_logger, AUTH_INVALID_STATISTICS_DATA);
             return (isc::data::ElementPtr());
         }
@@ -184,7 +182,7 @@ AuthCounters::inc(const Rcode rcode) {
     impl_->inc(rcode);
 }
 
-isc::data::ElementPtr
+isc::data::ConstElementPtr
 AuthCounters::getStatistics() const {
     return (impl_->getStatistics());
 }
diff --git a/src/bin/auth/statistics.h b/src/bin/auth/statistics.h
index 4b0eae2..0ca8da4 100644
--- a/src/bin/auth/statistics.h
+++ b/src/bin/auth/statistics.h
@@ -114,7 +114,7 @@ public:
     ///
     /// \return statistics data
     ///
-    isc::data::ElementPtr getStatistics() const;
+    isc::data::ConstElementPtr getStatistics() const;
 
     /// \brief Get the value of a counter in the AuthCounters.
     ///



More information about the bind10-changes mailing list