LocSetIterator.cpp

Go to the documentation of this file.
00001 #include "LocSetIterator.hpp"
00002 
00003 namespace OA {
00004 
00005 LocSetIterator::LocSetIterator(OA_ptr<LocSet> pSet) : mSet(pSet) {
00006     mIter = mSet->begin();
00007 }
00008 
00009 LocSetIterator::~LocSetIterator() { }
00010 
00011 OA_ptr<Location> LocSetIterator::current() {
00012     if (isValid()) {
00013         return *mIter; 
00014     } else {
00015         OA_ptr<Location> retval;
00016         return retval;
00017     }
00018 }
00019 
00020 bool LocSetIterator::isValid() {
00021     return (mIter != mSet->end());
00022 }
00023 
00024 void LocSetIterator::operator++() {
00025     if (mIter!=mSet->end()) ++mIter;
00026 }
00027 
00028 void LocSetIterator::reset() {
00029     mIter = mSet->begin();
00030 }
00031 
00032 } // end namespace