Commit aaba448c authored by Stanislav Bohm's avatar Stanislav Bohm

ENH: Registering API for datatypes simplified

parent 701cb31a
......@@ -72,11 +72,9 @@ Worker::Worker(uv_loop_t *loop,
llog->info("Using '{}' as working directory", work_dir);
}
add_unpacker(std::make_unique<SimpleUnpackFactory<RawDataUnpacker>>());
add_unpacker(std::make_unique<SimpleUnpackFactory<ArrayUnpacker>>());
add_unpacker(std::make_unique<SimpleUnpackFactory<IndexUnpacker>>());
add_unpacker<RawDataUnpacker>();
add_unpacker<ArrayUnpacker>();
add_unpacker<IndexUnpacker>();
resource_cpus = 1;
}
......
......@@ -123,6 +123,10 @@ public:
void set_cpus(int value);
void add_unpacker(std::unique_ptr<UnpackFactory> factory);
template<typename T> void add_unpacker()
{
add_unpacker(std::make_unique<SimpleUnpackFactory<T>>());
}
std::unique_ptr<DataUnpacker> unpack(DataTypeId id);
......
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