#include "test_builder.h"
#include "flatbuffers/flatbuffer_builder.h"
#include "flatbuffers/stl_emulation.h"
#include "monster_test_generated.h"
usingnamespaceMyGame::Example;
usingnamespaceflatbuffers;
struct OwnedAllocator : public DefaultAllocator { … };
class TestHeapBuilder : public FlatBufferBuilder { … };
struct AllocatorMember { … };
struct GrpcLikeMessageBuilder : private AllocatorMember,
public FlatBufferBuilder { … };
flatbuffers::Offset<Monster> populate1(
flatbuffers::FlatBufferBuilder &builder) { … }
flatbuffers::Offset<Monster> populate2(
flatbuffers::FlatBufferBuilder &builder) { … }
uint8_t *release_raw_base(flatbuffers::FlatBufferBuilder &fbb, size_t &size,
size_t &offset) { … }
void free_raw(flatbuffers::grpc::MessageBuilder &, uint8_t *) { … }
void free_raw(flatbuffers::FlatBufferBuilder &, uint8_t *buf) { … }
bool verify(const flatbuffers::DetachedBuffer &buf,
const std::string &expected_name, Color color) { … }
bool verify(const uint8_t *buf, size_t offset, const std::string &expected_name,
Color color) { … }
bool release_n_verify(flatbuffers::FlatBufferBuilder &fbb,
const std::string &expected_name, Color color) { … }
void FlatBufferBuilderTest();
void FlatBufferBuilderTest() { … }
void CheckTestGeneratedIsValid(const MyGame::Example::Color &);
void CheckTestGeneratedIsValid(const MyGame::Example::Color &) { … }