From: Yoshitaka Aharen Date: Tue, 29 Jan 2013 09:56:30 +0000 (+0900) Subject: [2157] update doxygen comments X-Git-Tag: bind10-1.1.0beta1-release~85^2~5^2~24 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=819407f4b51521da995e893f022c06853a6f40cd;p=thirdparty%2Fkea.git [2157] update doxygen comments --- diff --git a/src/lib/statistics/counter.h b/src/lib/statistics/counter.h index 186b294b98..27bfac4fb4 100644 --- a/src/lib/statistics/counter.h +++ b/src/lib/statistics/counter.h @@ -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) /// diff --git a/src/lib/statistics/counter_dict.h b/src/lib/statistics/counter_dict.h index 6fb74ceb58..08a8b37de8 100644 --- a/src/lib/statistics/counter_dict.h +++ b/src/lib/statistics/counter_dict.h @@ -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())); }