Browse Source

[2432] Rename iterator class to Iterator

Mukund Sivaraman 12 years ago
parent
commit
34929974f3
2 changed files with 14 additions and 14 deletions
  1. 11 11
      src/lib/dns/rrset_collection_base.h
  2. 3 3
      src/lib/dns/tests/rrset_collection_unittest.cc

+ 11 - 11
src/lib/dns/rrset_collection_base.h

@@ -105,11 +105,11 @@ public:
     ///
     /// It behaves like a \c std::iterator forward iterator, so please
     /// see its documentation for usage.
-    class iterator : std::iterator<std::forward_iterator_tag,
+    class Iterator : std::iterator<std::forward_iterator_tag,
                                    const isc::dns::AbstractRRset>
     {
     public:
-        explicit iterator(IterPtr iter) :
+        explicit Iterator(IterPtr iter) :
             iter_(iter)
         {}
 
@@ -117,22 +117,22 @@ public:
             return (iter_->getValue());
         }
 
-        iterator& operator++() {
+        Iterator& operator++() {
             iter_ = iter_->getNext();
             return (*this);
         }
 
-        iterator operator++(int) {
-            iterator tmp(iter_);
+        Iterator operator++(int) {
+            Iterator tmp(iter_);
             ++*this;
             return (tmp);
         }
 
-        bool operator==(const iterator& other) const {
+        bool operator==(const Iterator& other) const {
             return (iter_->equals(*other.iter_));
         }
 
-        bool operator!=(const iterator& other) const {
+        bool operator!=(const Iterator& other) const {
             return (!iter_->equals(*other.iter_));
         }
 
@@ -142,14 +142,14 @@ public:
 
     /// \brief Returns an iterator pointing to the beginning of the
     /// collection.
-    iterator begin() {
-      return iterator(getBeginning());
+    Iterator begin() {
+      return Iterator(getBeginning());
     }
 
     /// \brief Returns an iterator pointing past the end of the
     /// collection.
-    iterator end() {
-      return iterator(getEnd());
+    Iterator end() {
+      return Iterator(getEnd());
     }
 };
 

+ 3 - 3
src/lib/dns/tests/rrset_collection_unittest.cc

@@ -44,8 +44,8 @@ TEST_F(RRsetCollectionTest, istreamConstructor) {
     std::ifstream fs(TEST_DATA_SRCDIR "/example.org");
     RRsetCollection collection2(fs, origin, rrclass);
 
-    RRsetCollectionBase::iterator iter = collection.begin();
-    RRsetCollectionBase::iterator iter2 = collection2.begin();
+    RRsetCollectionBase::Iterator iter = collection.begin();
+    RRsetCollectionBase::Iterator iter2 = collection2.begin();
     while (iter != collection.end()) {
          EXPECT_TRUE(iter2 != collection2.end());
          EXPECT_EQ((*iter).toText(), (*iter2).toText());
@@ -184,7 +184,7 @@ TEST_F(RRsetCollectionTest, iteratorTest) {
 
     // Here, we just count the records and do some basic tests on them.
     size_t count = 0;
-    for (RRsetCollection::iterator it = collection.begin();
+    for (RRsetCollection::Iterator it = collection.begin();
          it != collection.end(); ++it) {
          ++count;
          const AbstractRRset& rrset = *it;