Class reader
Synopsis
#include <include/flecs/cpp/reader_writer.hpp>
class reader final
Description
No description yet.
Methods
reader overload | ||
read |
Source
Lines 9-27 in include/flecs/cpp/reader_writer.hpp.
class reader final {
public:
explicit reader(world& world) {
m_reader = ecs_reader_init(world.c_ptr());
}
reader(world& world, snapshot& snapshot) {
(void)world;
ecs_iter_t it = ecs_snapshot_iter(snapshot.c_ptr(), nullptr);
m_reader = ecs_reader_init_w_iter(&it, ecs_snapshot_next);
}
int32_t read(char *buffer, int64_t size) {
return ecs_reader_read(buffer, static_cast<int32_t>(size), &m_reader);
}
private:
ecs_reader_t m_reader;
};