MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / ChunkGenerator

Method ChunkGenerator

extlibs/catch/include/catch/catch.hpp:4206–4219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4204 bool m_used_up = false;
4205 public:
4206 ChunkGenerator(size_t size, GeneratorWrapper<T> generator) :
4207 m_chunk_size(size), m_generator(std::move(generator))
4208 {
4209 m_chunk.reserve(m_chunk_size);
4210 if (m_chunk_size != 0) {
4211 m_chunk.push_back(m_generator.get());
4212 for (size_t i = 1; i < m_chunk_size; ++i) {
4213 if (!m_generator.next()) {
4214 Catch::throw_exception(GeneratorException("Not enough values to initialize the first chunk"));
4215 }
4216 m_chunk.push_back(m_generator.get());
4217 }
4218 }
4219 }
4220 std::vector<T> const& get() const override {
4221 return m_chunk;
4222 }

Callers

nothing calls this directly

Calls 6

throw_exceptionFunction · 0.85
GeneratorExceptionClass · 0.85
reserveMethod · 0.45
push_backMethod · 0.45
getMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected