diff options
Diffstat (limited to 'common/entitybuffer.h')
-rw-r--r-- | common/entitybuffer.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/common/entitybuffer.h b/common/entitybuffer.h index 097b450..f22c84e 100644 --- a/common/entitybuffer.h +++ b/common/entitybuffer.h | |||
@@ -15,7 +15,14 @@ public: | |||
15 | const Entity &entity(); | 15 | const Entity &entity(); |
16 | 16 | ||
17 | static void extractResourceBuffer(void *dataValue, int dataSize, const std::function<void(const uint8_t *, size_t size)> &handler); | 17 | static void extractResourceBuffer(void *dataValue, int dataSize, const std::function<void(const uint8_t *, size_t size)> &handler); |
18 | /* | ||
19 | * TODO: Ideally we would be passing references to vectors in the same bufferbuilder, to avoid needlessly copying data. | ||
20 | * Unfortunately I couldn't find a way to cast a table to a vector<uint8_t> reference. | ||
21 | * We can't use union's either (which would allow to have a field that stores a selection of tables), as we don't want to modify | ||
22 | * the entity schema for each resource's buffers. | ||
23 | */ | ||
18 | static void assembleEntityBuffer(flatbuffers::FlatBufferBuilder &fbb, void const *metadataData, size_t metadataSize, void const *resourceData, size_t resourceSize, void const *localData, size_t localSize); | 24 | static void assembleEntityBuffer(flatbuffers::FlatBufferBuilder &fbb, void const *metadataData, size_t metadataSize, void const *resourceData, size_t resourceSize, void const *localData, size_t localSize); |
25 | static flatbuffers::Offset<flatbuffers::Vector<uint8_t> > appendAsVector(flatbuffers::FlatBufferBuilder &fbb, void const *data, size_t size); | ||
19 | 26 | ||
20 | private: | 27 | private: |
21 | const Entity *mEntity; | 28 | const Entity *mEntity; |