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:
///
/// 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());
}
};
......
......@@ -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;
......
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