Commit 34929974 authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

[2432] Rename iterator class to Iterator

parent 98d515d5
...@@ -105,11 +105,11 @@ public: ...@@ -105,11 +105,11 @@ public:
/// ///
/// It behaves like a \c std::iterator forward iterator, so please /// It behaves like a \c std::iterator forward iterator, so please
/// see its documentation for usage. /// 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> const isc::dns::AbstractRRset>
{ {
public: public:
explicit iterator(IterPtr iter) : explicit Iterator(IterPtr iter) :
iter_(iter) iter_(iter)
{} {}
...@@ -117,22 +117,22 @@ public: ...@@ -117,22 +117,22 @@ public:
return (iter_->getValue()); return (iter_->getValue());
} }
iterator& operator++() { Iterator& operator++() {
iter_ = iter_->getNext(); iter_ = iter_->getNext();
return (*this); return (*this);
} }
iterator operator++(int) { Iterator operator++(int) {
iterator tmp(iter_); Iterator tmp(iter_);
++*this; ++*this;
return (tmp); return (tmp);
} }
bool operator==(const iterator& other) const { bool operator==(const Iterator& other) const {
return (iter_->equals(*other.iter_)); return (iter_->equals(*other.iter_));
} }
bool operator!=(const iterator& other) const { bool operator!=(const Iterator& other) const {
return (!iter_->equals(*other.iter_)); return (!iter_->equals(*other.iter_));
} }
...@@ -142,14 +142,14 @@ public: ...@@ -142,14 +142,14 @@ public:
/// \brief Returns an iterator pointing to the beginning of the /// \brief Returns an iterator pointing to the beginning of the
/// collection. /// collection.
iterator begin() { Iterator begin() {
return iterator(getBeginning()); return Iterator(getBeginning());
} }
/// \brief Returns an iterator pointing past the end of the /// \brief Returns an iterator pointing past the end of the
/// collection. /// collection.
iterator end() { Iterator end() {
return iterator(getEnd()); return Iterator(getEnd());
} }
}; };
......
...@@ -44,8 +44,8 @@ TEST_F(RRsetCollectionTest, istreamConstructor) { ...@@ -44,8 +44,8 @@ TEST_F(RRsetCollectionTest, istreamConstructor) {
std::ifstream fs(TEST_DATA_SRCDIR "/example.org"); std::ifstream fs(TEST_DATA_SRCDIR "/example.org");
RRsetCollection collection2(fs, origin, rrclass); RRsetCollection collection2(fs, origin, rrclass);
RRsetCollectionBase::iterator iter = collection.begin(); RRsetCollectionBase::Iterator iter = collection.begin();
RRsetCollectionBase::iterator iter2 = collection2.begin(); RRsetCollectionBase::Iterator iter2 = collection2.begin();
while (iter != collection.end()) { while (iter != collection.end()) {
EXPECT_TRUE(iter2 != collection2.end()); EXPECT_TRUE(iter2 != collection2.end());
EXPECT_EQ((*iter).toText(), (*iter2).toText()); EXPECT_EQ((*iter).toText(), (*iter2).toText());
...@@ -184,7 +184,7 @@ TEST_F(RRsetCollectionTest, iteratorTest) { ...@@ -184,7 +184,7 @@ TEST_F(RRsetCollectionTest, iteratorTest) {
// Here, we just count the records and do some basic tests on them. // Here, we just count the records and do some basic tests on them.
size_t count = 0; size_t count = 0;
for (RRsetCollection::iterator it = collection.begin(); for (RRsetCollection::Iterator it = collection.begin();
it != collection.end(); ++it) { it != collection.end(); ++it) {
++count; ++count;
const AbstractRRset& rrset = *it; const AbstractRRset& rrset = *it;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment