16#include <spdlog/logger.h>
29template <
typename T,
typename B>
33inline void write(T&& data, FILE* file);
40void uncompressBuffer(
const std::vector<uint8_t>& lz4Buf, std::vector<uint8_t>& memBuf, std::size_t decompressedSize);
42[[nodiscard]] FILE*
openFile(
const std::filesystem::path& path);
45[[nodiscard]] const ::sen::ClassType*
searchOwner(const ::sen::ClassType* classType,
46 const ::sen::Property* property)
noexcept;
49[[nodiscard]] const ::sen::ClassType*
searchOwner(const ::sen::ClassType* classType,
50 const ::sen::Event* event)
noexcept;
54 const ::sen::Property* property);
71inline void write(T&& data, FILE* file)
73 auto block = std::make_shared<ResizableHeapBlock>();
77 doWrite(block->getConstSpan(), file);
80template <
typename T,
typename B>
93 auto buffer = std::make_shared<ResizableHeapBlock>();
void writeUInt32(uint32_t val)
Definition output_stream.h:44
A writer that owns a buffer that gets resized on demand.
Definition buffer_writer.h:58
Contiguous view of elements of type T. Inspired by http://www.open-std.org/jtc1/sc22/wg21/docs/papers...
Definition span.h:34
Definition type_traits.h:47
Definition annotation.h:20
void doWrite(const Span< const uint8_t > &span, FILE *file)
const ::sen::ClassType * searchOwner(const ::sen::ClassType *classType, const ::sen::Property *property) noexcept
Returns the class in the hierarchy of classes that owns the property. Returns nullptr if not found.
void uncompressBuffer(const std::vector< uint8_t > &lz4Buf, std::vector< uint8_t > &memBuf, std::size_t decompressedSize)
uint32_t getFileHeaderSize()
Definition db/src/util.h:65
FILE * openFile(const std::filesystem::path &path)
MemberHash computePlatformDependentEventId(const ::sen::ClassType *classType, const ::sen::Event *event)
Computes the old version (platform-dependent) of the event id. Used for retro-compatibility.
void writeToBuffer(const T &data, B &buffer)
Definition db/src/util.h:81
void write(T &&data, FILE *file)
Definition db/src/util.h:71
std::shared_ptr< ResizableHeapBlock > writeSizeAndDataToBuffer(const T &data)
Definition db/src/util.h:90
std::shared_ptr< spdlog::logger > getLogger()
void writeToCompressedBuffer(const std::vector< uint8_t > &memBuf, std::vector< uint8_t > &lz4Buf)
MemberHash computePlatformDependentPropertyId(const ::sen::ClassType *classType, const ::sen::Property *property)
Computes the old version (platform-dependent) of the property id. Used for retro-compatibility.
OutputStreamTemplate< LittleEndian > OutputStream
Definition output_stream.h:64
The hash of a member.
Definition type.h:39