static_ds_la_SOURCES = static_datasrc_link.cc
static_ds_la_LDFLAGS = -module -avoid-version
static_ds_la_LIBADD = $(top_builddir)/src/lib/exceptions/libb10-exceptions.la
+static_ds_la_LIBADD += $(top_builddir)/src/lib/datasrc/memory/libdatasrc_memory.la
static_ds_la_LIBADD += libb10-datasrc.la
libb10_datasrc_la_LIBADD = $(top_builddir)/src/lib/exceptions/libb10-exceptions.la
#include "client.h"
#include "memory_datasrc.h"
+#include <datasrc/memory/memory_client.h>
+#include <datasrc/memory/zone_table_segment.h>
#include <cc/data.h>
#include <dns/rrclass.h>
DataSourceClient*
createInstance(ConstElementPtr config, string& error) {
try {
+ shared_ptr<memory::ZoneTableSegment> ztable_segment(
+ memory::ZoneTableSegment::create(*config, RRClass::CH()));
// Create the data source
- auto_ptr<InMemoryClient> client(new InMemoryClient());
- // Hardcode the origin and class
- shared_ptr<InMemoryZoneFinder>
- finder(new InMemoryZoneFinder(RRClass::CH(), Name("BIND")));
+ auto_ptr<memory::InMemoryClient> client
+ (new memory::InMemoryClient(ztable_segment, RRClass::CH()));
+
// Fill it with data
const string path(config->stringValue());
- finder->load(path);
- // And put the zone inside
- client->addZone(finder);
+ client->load(Name("BIND"), path);
+
return (client.release());
}
catch (const std::exception& e) {