MCPcopy Create free account
hub / github.com/apache/trafficserver / ChunkGenerator

Method ChunkGenerator

lib/catch2/catch.hpp:4303–4316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4301 bool m_used_up = false;
4302 public:
4303 ChunkGenerator(size_t size, GeneratorWrapper<T> generator) :
4304 m_chunk_size(size), m_generator(std::move(generator))
4305 {
4306 m_chunk.reserve(m_chunk_size);
4307 if (m_chunk_size != 0) {
4308 m_chunk.push_back(m_generator.get());
4309 for (size_t i = 1; i < m_chunk_size; ++i) {
4310 if (!m_generator.next()) {
4311 Catch::throw_exception(GeneratorException("Not enough values to initialize the first chunk"));
4312 }
4313 m_chunk.push_back(m_generator.get());
4314 }
4315 }
4316 }
4317 std::vector<T> const& get() const override {
4318 return m_chunk;
4319 }

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