};
public:
- InMemoryClientImpl(RRClass rrclass) :
+ InMemoryClientImpl(util::MemorySegment& mem_sgmt,
+ RRClass rrclass) :
+ local_mem_sgmt_(mem_sgmt),
rrclass_(rrclass),
zone_count_(0),
zone_table_(ZoneTable::create(local_mem_sgmt_, rrclass)),
// Memory segment to allocate/deallocate memory for the zone table.
// (This will eventually have to be abstract; for now we hardcode the
// specific derived segment class).
- util::MemorySegmentLocal local_mem_sgmt_;
+ util::MemorySegment& local_mem_sgmt_;
const RRClass rrclass_;
unsigned int zone_count_;
ZoneTable* zone_table_;
}
}
-InMemoryClient::InMemoryClient(RRClass rrclass) :
- impl_(new InMemoryClientImpl(rrclass))
+InMemoryClient::InMemoryClient(util::MemorySegment& mem_sgmt,
+ RRClass rrclass) :
+ impl_(new InMemoryClientImpl(mem_sgmt, rrclass))
{}
InMemoryClient::~InMemoryClient() {
#ifndef DATASRC_MEMORY_CLIENT_H
#define DATASRC_MEMORY_CLIENT_H 1
+#include <util/memory_segment.h>
+
#include <datasrc/iterator.h>
#include <datasrc/client.h>
#include <datasrc/memory/zone_table.h>
/// This constructor internally involves resource allocation, and if
/// it fails, a corresponding standard exception will be thrown.
/// It never throws an exception otherwise.
- InMemoryClient(isc::dns::RRClass rrclass);
+ InMemoryClient(util::MemorySegment& mem_sgmt,
+ isc::dns::RRClass rrclass);
/// The destructor.
~InMemoryClient();
class MemoryClientTest : public ::testing::Test {
protected:
MemoryClientTest() : zclass_(RRClass::IN()),
- client_(new InMemoryClient(zclass_))
+ client_(new InMemoryClient(mem_sgmt_, zclass_))
{}
~MemoryClientTest() {
if (client_ != NULL) {