BIND 10 trac510, updated. 657349ae281dcdf737b187d0be2cd7d0e4fa92a7 [510] style fixes

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Aug 24 13:48:50 UTC 2011


The branch, trac510 has been updated
       via  657349ae281dcdf737b187d0be2cd7d0e4fa92a7 (commit)
      from  a7505fac495a9746d8bf3e9a2f4a3aa8541b85c2 (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 657349ae281dcdf737b187d0be2cd7d0e4fa92a7
Author: Jelte Jansen <jelte at isc.org>
Date:   Wed Aug 24 15:35:14 2011 +0200

    [510] style fixes

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

Summary of changes:
 src/lib/statistics/counter.h              |   68 ++++----
 src/lib/statistics/counter_dict.cc        |   32 ++--
 src/lib/statistics/counter_dict.h         |  261 ++++++++++++++---------------
 src/lib/statistics/tests/run_unittests.cc |    4 +-
 4 files changed, 182 insertions(+), 183 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/statistics/counter.h b/src/lib/statistics/counter.h
index 2af0bc4..b077616 100644
--- a/src/lib/statistics/counter.h
+++ b/src/lib/statistics/counter.h
@@ -13,40 +13,40 @@ namespace statistics {
 class CounterImpl;
 
 class Counter : boost::noncopyable {
-    private:
-        boost::scoped_ptr<CounterImpl> impl_;
-    public:
-        typedef unsigned int Type;
-        typedef unsigned int Value;
-
-        /// The constructor.
-        ///
-        /// This constructor is mostly exception free. But it may still throw
-        /// a standard exception if memory allocation fails inside the method.
-        /// 
-        /// \param items A number of counter items to hold (greater than 0)
-        ///
-        /// \throw isc::InvalidParameter \a items is 0
-        Counter(const size_t items);
-
-        /// The destructor.
-        ///
-        /// This method never throws an exception.
-        ~Counter();
-
-        /// \brief Increment a counter item specified with \a type.
-        /// 
-        /// \param type %Counter item to increment
-        ///
-        /// \throw isc::OutOfRange \a type is invalid
-        void inc(const Type& type);
-
-        /// \brief Get the value of a counter item specified with \a type.
-        /// 
-        /// \param type %Counter item to get the value of
-        ///
-        /// \throw isc::OutOfRange \a type is invalid
-        const Value& get(const Type& type) const;
+private:
+    boost::scoped_ptr<CounterImpl> impl_;
+public:
+    typedef unsigned int Type;
+    typedef unsigned int Value;
+
+    /// The constructor.
+    ///
+    /// This constructor is mostly exception free. But it may still throw
+    /// a standard exception if memory allocation fails inside the method.
+    ///
+    /// \param items A number of counter items to hold (greater than 0)
+    ///
+    /// \throw isc::InvalidParameter \a items is 0
+    Counter(const size_t items);
+
+    /// The destructor.
+    ///
+    /// This method never throws an exception.
+    ~Counter();
+
+    /// \brief Increment a counter item specified with \a type.
+    ///
+    /// \param type %Counter item to increment
+    ///
+    /// \throw isc::OutOfRange \a type is invalid
+    void inc(const Type& type);
+
+    /// \brief Get the value of a counter item specified with \a type.
+    ///
+    /// \param type %Counter item to get the value of
+    ///
+    /// \throw isc::OutOfRange \a type is invalid
+    const Value& get(const Type& type) const;
 };
 
 }   // namespace statistics
diff --git a/src/lib/statistics/counter_dict.cc b/src/lib/statistics/counter_dict.cc
index 8314b46..7aa36a5 100644
--- a/src/lib/statistics/counter_dict.cc
+++ b/src/lib/statistics/counter_dict.cc
@@ -19,22 +19,22 @@ namespace statistics {
 class CounterDictionaryConstIteratorImpl;
 
 class CounterDictionaryImpl : boost::noncopyable {
-    private:
-        DictionaryMap dictionary_;
-        std::vector<std::string> elements_;
-        const size_t items_;
-        // Default constructor is forbidden; number of counter items must be
-        // specified at the construction of this class.
-        CounterDictionaryImpl();
-    public:
-        CounterDictionaryImpl(const size_t items);
-        ~CounterDictionaryImpl();
-        void addElement(const std::string& name);
-        void deleteElement(const std::string& name);
-        Counter& getElement(const std::string& name);
-    public:
-        CounterDictionaryConstIteratorImpl begin() const;
-        CounterDictionaryConstIteratorImpl end() const;
+private:
+    DictionaryMap dictionary_;
+    std::vector<std::string> elements_;
+    const size_t items_;
+    // Default constructor is forbidden; number of counter items must be
+    // specified at the construction of this class.
+    CounterDictionaryImpl();
+public:
+    CounterDictionaryImpl(const size_t items);
+    ~CounterDictionaryImpl();
+    void addElement(const std::string& name);
+    void deleteElement(const std::string& name);
+    Counter& getElement(const std::string& name);
+public:
+    CounterDictionaryConstIteratorImpl begin() const;
+    CounterDictionaryConstIteratorImpl end() const;
 };
 
 // Constructor with number of items
diff --git a/src/lib/statistics/counter_dict.h b/src/lib/statistics/counter_dict.h
index be455b6..f5c1fbd 100644
--- a/src/lib/statistics/counter_dict.h
+++ b/src/lib/statistics/counter_dict.h
@@ -18,137 +18,136 @@ class CounterDictionaryImpl;
 class CounterDictionaryConstIteratorImpl;
 
 class CounterDictionary : boost::noncopyable {
-    private:
-        boost::scoped_ptr<CounterDictionaryImpl> impl_;
-        // Default constructor is forbidden; number of counter items must be
-        // specified at the construction of this class.
-        CounterDictionary();
-    public:
-        /// The constructor.
-        /// This constructor is mostly exception free. But it may still throw
-        /// a standard exception if memory allocation fails inside the method.
-        /// 
-        /// \param items A number of counter items to hold (greater than 0)
-        ///
-        /// \throw isc::InvalidParameter \a items is 0
-        CounterDictionary(const size_t items);
-
-        /// The destructor.
-        ///
-        /// This method never throws an exception.
-        ~CounterDictionary();
-
-        /// \brief Add an element
-        ///
-        /// \throw isc::InvalidParameter \a element already exists.
-        ///
-        /// \param name A name of the element to append
-        void addElement(const std::string& name);
-
-        /// \brief Delete
-        ///
-        /// \throw isc::OutOfRange \a element does not exist.
-        ///
-        /// \param name A name of the element to delete
-        void deleteElement(const std::string& name);
-
-        /// \brief Lookup
-        ///
-        /// \throw isc::OutOfRange \a element does not exist.
-        ///
-        /// \param name A name of the element to get the counters
-        Counter& getElement(const std::string &name) const;
-
-        /// Same as getElement()
-        Counter& operator[](const std::string &name) const;
-
-        /// \brief A helper structure to represent an element of
-        /// CounterDictionary. This type is used for the iterator.
-        struct ValueType {
-            public:
-            const std::string& name;
-            const Counter& element;
-            ValueType(const std::string& name_, const Counter& element_) :
-                name(name_), element(element_)
-            {}
-        };
-
-        /// \brief \c ConstIterator is a constant iterator that provides an
-        /// interface for accessing elements stored in CounterDictionary.
-        ///
-        /// This class is derived from boost::iterator_facade and uses pImpl
-        /// idiom not to expose implementation detail of
-        /// CounterDictionary::iterator.
-        ///
-        /// It is intended to walk through the elements when sending the
-        /// counters to statistics module.
-        class ConstIterator :
-            public boost::iterator_facade<ConstIterator,
-                                   const ValueType,
-                                   boost::forward_traversal_tag>
-        {
-            private:
-                boost::scoped_ptr<CounterDictionaryConstIteratorImpl> impl_;
-            public:
-                /// The constructor.
-                ///
-                /// This constructor is mostly exception free. But it may still
-                /// throw a standard exception if memory allocation fails
-                /// inside the method.
-                ConstIterator();
-                /// The destructor.
-                /// 
-                /// This method never throws an exception.
-                ~ConstIterator();
-                /// The assignment operator.
-                ///
-                /// This method is mostly exception free. But it may still
-                /// throw a standard exception if memory allocation fails
-                /// inside the method.
-                ConstIterator& operator=(const ConstIterator &source);
-                /// The copy constructor.
-                ///
-                /// This constructor is mostly exception free. But it may still
-                /// throw a standard exception if memory allocation fails
-                /// inside the method.
-                ConstIterator(const ConstIterator& source);
-                /// The constructor from implementation detail.
-                /// 
-                /// This method is used to create an instance of ConstIterator
-                /// by CounterDict::begin() and CounterDict::end().
-                ///
-                /// This constructor is mostly exception free. But it may still
-                /// throw a standard exception if memory allocation fails
-                /// inside the method.
-                ConstIterator(
-                    const CounterDictionaryConstIteratorImpl& source);
-            private:
-                /// \brief An internal method to increment this iterator.
-                void increment();
-                /// \brief An internal method to check equality.
-                bool equal(const ConstIterator& other) const;
-                /// \brief An internal method to dereference this iterator.
-                const value_type dereference() const;
-            private:
-                friend class boost::iterator_core_access;
-        };
-
-        typedef ConstIterator const_iterator;
-
-        /// \brief Return an iterator corresponding to the beginning of the
-        /// elements stored in CounterDictionary.
-        ///
-        /// This method is mostly exception free. But it may still throw a
-        /// standard exception if memory allocation fails inside the method.
-        const_iterator begin() const;
-
-        /// \brief Return an iterator corresponding to the end of the elements
-        /// stored in CounterDictionary.
-        ///
-        /// This method is mostly exception free. But it may still throw a
-        /// standard exception if memory allocation fails inside the method.
-        const_iterator end() const;
-
+private:
+    boost::scoped_ptr<CounterDictionaryImpl> impl_;
+    // Default constructor is forbidden; number of counter items must be
+    // specified at the construction of this class.
+    CounterDictionary();
+public:
+    /// The constructor.
+    /// This constructor is mostly exception free. But it may still throw
+    /// a standard exception if memory allocation fails inside the method.
+    ///
+    /// \param items A number of counter items to hold (greater than 0)
+    ///
+    /// \throw isc::InvalidParameter \a items is 0
+    CounterDictionary(const size_t items);
+
+    /// The destructor.
+    ///
+    /// This method never throws an exception.
+    ~CounterDictionary();
+
+    /// \brief Add an element
+    ///
+    /// \throw isc::InvalidParameter \a element already exists.
+    ///
+    /// \param name A name of the element to append
+    void addElement(const std::string& name);
+
+    /// \brief Delete
+    ///
+    /// \throw isc::OutOfRange \a element does not exist.
+    ///
+    /// \param name A name of the element to delete
+    void deleteElement(const std::string& name);
+
+    /// \brief Lookup
+    ///
+    /// \throw isc::OutOfRange \a element does not exist.
+    ///
+    /// \param name A name of the element to get the counters
+    Counter& getElement(const std::string &name) const;
+
+    /// Same as getElement()
+    Counter& operator[](const std::string &name) const;
+
+    /// \brief A helper structure to represent an element of
+    /// CounterDictionary. This type is used for the iterator.
+    struct ValueType {
+        public:
+        const std::string& name;
+        const Counter& element;
+        ValueType(const std::string& name_, const Counter& element_) :
+            name(name_), element(element_)
+        {}
+    };
+
+    /// \brief \c ConstIterator is a constant iterator that provides an
+    /// interface for accessing elements stored in CounterDictionary.
+    ///
+    /// This class is derived from boost::iterator_facade and uses pImpl
+    /// idiom not to expose implementation detail of
+    /// CounterDictionary::iterator.
+    ///
+    /// It is intended to walk through the elements when sending the
+    /// counters to statistics module.
+    class ConstIterator :
+        public boost::iterator_facade<ConstIterator,
+                                const ValueType,
+                                boost::forward_traversal_tag>
+    {
+        private:
+            boost::scoped_ptr<CounterDictionaryConstIteratorImpl> impl_;
+        public:
+            /// The constructor.
+            ///
+            /// This constructor is mostly exception free. But it may still
+            /// throw a standard exception if memory allocation fails
+            /// inside the method.
+            ConstIterator();
+            /// The destructor.
+            ///
+            /// This method never throws an exception.
+            ~ConstIterator();
+            /// The assignment operator.
+            ///
+            /// This method is mostly exception free. But it may still
+            /// throw a standard exception if memory allocation fails
+            /// inside the method.
+            ConstIterator& operator=(const ConstIterator &source);
+            /// The copy constructor.
+            ///
+            /// This constructor is mostly exception free. But it may still
+            /// throw a standard exception if memory allocation fails
+            /// inside the method.
+            ConstIterator(const ConstIterator& source);
+            /// The constructor from implementation detail.
+            ///
+            /// This method is used to create an instance of ConstIterator
+            /// by CounterDict::begin() and CounterDict::end().
+            ///
+            /// This constructor is mostly exception free. But it may still
+            /// throw a standard exception if memory allocation fails
+            /// inside the method.
+            ConstIterator(
+                const CounterDictionaryConstIteratorImpl& source);
+        private:
+            /// \brief An internal method to increment this iterator.
+            void increment();
+            /// \brief An internal method to check equality.
+            bool equal(const ConstIterator& other) const;
+            /// \brief An internal method to dereference this iterator.
+            const value_type dereference() const;
+        private:
+            friend class boost::iterator_core_access;
+    };
+
+    typedef ConstIterator const_iterator;
+
+    /// \brief Return an iterator corresponding to the beginning of the
+    /// elements stored in CounterDictionary.
+    ///
+    /// This method is mostly exception free. But it may still throw a
+    /// standard exception if memory allocation fails inside the method.
+    const_iterator begin() const;
+
+    /// \brief Return an iterator corresponding to the end of the elements
+    /// stored in CounterDictionary.
+    ///
+    /// This method is mostly exception free. But it may still throw a
+    /// standard exception if memory allocation fails inside the method.
+    const_iterator end() const;
 };
 
 }   // namespace statistics
diff --git a/src/lib/statistics/tests/run_unittests.cc b/src/lib/statistics/tests/run_unittests.cc
index b07ce7e..38a299e 100644
--- a/src/lib/statistics/tests/run_unittests.cc
+++ b/src/lib/statistics/tests/run_unittests.cc
@@ -14,12 +14,12 @@
 
 #include <gtest/gtest.h>
 #include <util/unittests/run_all.h>
-#include <log/logger_manager.h>
+#include <log/logger_support.h>
 
 int
 main(int argc, char* argv[])
 {
     ::testing::InitGoogleTest(&argc, argv);         // Initialize Google test
-    isc::log::LoggerManager::init("unittest");      // Set a root logger name
+    isc::log::initLogger();
     return (isc::util::unittests::run_all());
 }




More information about the bind10-changes mailing list