]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2157] update doxygen comments
authorYoshitaka Aharen <aharen@jprs.co.jp>
Tue, 29 Jan 2013 09:56:30 +0000 (18:56 +0900)
committerYoshitaka Aharen <aharen@jprs.co.jp>
Tue, 29 Jan 2013 09:56:30 +0000 (18:56 +0900)
src/lib/statistics/counter.h
src/lib/statistics/counter_dict.h

index 186b294b98bee8a03b68fe520a93eae02aa5be52..27bfac4fb411b46de392cadd9681709018a382be 100644 (file)
@@ -37,8 +37,9 @@ private:
 public:
     /// The constructor.
     ///
-    /// This constructor is mostly exception free. But it may still throw
-    /// a standard exception if memory allocation fails inside the method.
+    /// This constructor prepares a set of counters which has \a items
+    /// elements. The counters will be initialized with \a InitialValue;
+    /// which is defined as 0.
     ///
     /// \param items A number of counter items to hold (greater than 0)
     ///
index 6fb74ceb58ab3e10944a0e4d0f36d5982de09ae7..08a8b37de807d9eb50e5b4c4c149cd836687749e 100644 (file)
@@ -46,6 +46,16 @@ private:
     // specified at the construction of this class.
     CounterDictionary();
 public:
+    /// The constructor.
+    ///
+    /// This constructor prepares a dictionary of set of counters.
+    /// Initially the dictionary is empty.
+    /// Each counter has \a items elements. The counters will be initialized
+    /// with \a InitialValue; which is defined as 0.
+    ///
+    /// \param items A number of counter items to hold (greater than 0)
+    ///
+    /// \throw isc::InvalidParameter \a items is 0
     explicit CounterDictionary(const size_t items) :
         items_(items)
     {
@@ -54,6 +64,13 @@ public:
             isc_throw(isc::InvalidParameter, "Items must not be 0");
         }
     }
+
+    /// \brief Add an element which has a key \a name to the dictionary.
+    ///
+    /// \param name A key of the element to add
+    ///
+    /// \throw isc::InvalidParameter an element which has \a name as key
+    ///                              already exists
     void addElement(const std::string& name) {
         // throw if the element already exists
         if (dictionary_.count(name) != 0) {
@@ -65,6 +82,13 @@ public:
         dictionary_.insert(
             DictionaryMap::value_type(name, CounterPtr(new Counter(items_))));
     }
+
+    /// \brief Delete the element which has a key \a name from the dictionary.
+    ///
+    /// \param name A key of the element to delete
+    ///
+    /// \throw isc::OutOfRange an element which has \a name as key does not
+    ///                        exist
     void deleteElement(const std::string& name) {
         const size_t result = dictionary_.erase(name);
         if (result != 1) {
@@ -74,6 +98,13 @@ public:
                       "Element " << name << " does not exist");
         }
     }
+
+    /// \brief Get a reference to a %Counter which has \a name as key
+    ///
+    /// \param name A key of the element
+    ///
+    /// \throw isc::OutOfRange an element which has \a name as key does not
+    ///                        exist
     Counter& getElement(const std::string& name) {
         DictionaryMap::const_iterator i = dictionary_.find(name);
         if (i != dictionary_.end()) {
@@ -86,9 +117,12 @@ public:
                       "Element " << name << " does not exist");
         }
     }
+
+    /// \brief Same as \c getElement()
     Counter& operator[](const std::string& name) {
         return (getElement(name));
     }
+
     /// \brief \c ConstIterator is a constant iterator that provides an
     /// interface for enumerating name of zones stored in CounterDictionary.
     ///
@@ -117,18 +151,18 @@ public:
             {}
 
         private:
-            /// \brief An internal method to increment this iterator.
+            // An internal method to increment this iterator.
             void increment() {
                 ++iterator_;
                 return;
             }
 
-            /// \brief An internal method to check equality.
+            // An internal method to check equality.
             bool equal(const ConstIterator& other) const {
                 return (iterator_ == other.iterator_);
             }
 
-            /// \brief An internal method to dereference this iterator.
+            // An internal method to dereference this iterator.
             const value_type& dereference() const {
                 return (iterator_->first);
             }
@@ -138,9 +172,12 @@ public:
             DictionaryMap::const_iterator iterator_;
     };
 
+    /// \brief Get an iterator for the beginning of the dictionary.
     ConstIterator begin() const {
         return (CounterDictionary::ConstIterator(dictionary_.begin()));
     }
+
+    /// \brief Get an iterator for the end of the dictionary.
     ConstIterator end() const {
         return (CounterDictionary::ConstIterator(dictionary_.end()));
     }