Commit 3744e7a8 authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

[2268] Add MockVectorIterator class

parent e93e6f38
......@@ -46,6 +46,7 @@ using namespace isc::dns::rdata;
using namespace isc::datasrc;
using namespace isc::datasrc::memory;
using namespace isc::testutils;
using std::vector;
namespace {
......@@ -124,6 +125,34 @@ public:
}
};
class MockVectorIterator : public ZoneIterator {
private:
MockVectorIterator(const vector<ConstRRsetPtr>& rrsets) :
rrsets_(rrsets),
counter_(0)
{}
const vector<ConstRRsetPtr> rrsets_;
int counter_;
public:
virtual ConstRRsetPtr getNextRRset() {
if (counter_ >= rrsets_.size()) {
return (ConstRRsetPtr());
}
return (rrsets_[counter_++]);
}
virtual ConstRRsetPtr getSOA() const {
isc_throw(isc::NotImplemented, "Not implemented");
}
static ZoneIteratorPtr makeIterator(const vector<ConstRRsetPtr>& rrsets) {
return (ZoneIteratorPtr(new MockVectorIterator(rrsets)));
}
};
class MockIteratorRRSIGMixedCovered : public ZoneIterator {
private:
MockIteratorRRSIGMixedCovered(RRClass rrclass) :
......
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