22#include <vrs/ForwardDefinitions.h>
23#include <vrs/StreamId.h>
24#include <vrs/VrsExport.h>
25#include <vrs/helpers/EnumTemplates.hpp>
26#include <vrs/helpers/IOVector.h>
34class DirectWriteRecordData;
92 enum class Type : uint8_t {
110 uint32_t formatVersion,
112 uint64_t creationOrder);
115 void addDirectWriteRecordData(unique_ptr<DirectWriteRecordData>&& directWriteRecordData);
120 bool shouldTryToCompress()
const;
126 int compressRecord(
Compressor& compressor, uint32_t& outCompressedSize);
133 uint32_t& inOutRecordSize,
135 uint32_t compressedSize);
142 uint64_t getCreationOrder()
const {
143 return creationOrder_;
148 return usedBufferSize_;
157 static const char* typeName(Type type);
168 uint32_t formatVersion_{};
169 helpers::IOVector<uint8_t> buffer_;
170 size_t usedBufferSize_{};
171 uint64_t creationOrder_{};
172 unique_ptr<DirectWriteRecordData> directWriteRecordData_;
174 RecordManager& recordManager_;
Helper class to compress data using lz4 or zstd presets.
Definition Compressor.h:82
A class referencing data to be captured in a record at creation.
Definition DataSource.h:153
Essential VRS class holding a record's details and payload in memory during creation.
Definition Record.h:83
Type getRecordType() const
Get the record's record type.
Definition Record.h:152
Type
Definition Record.h:92
double getTimestamp() const
Get the record's timestamp.
Definition Record.h:138
static const double kMaxTimestamp
Maximum timestamp for a record.
Definition Record.h:86
size_t getSize() const
Get the record's payload size, uncompressed.
Definition Record.h:147
VRS internal class to manage the records of a specific Recordable after their creation.
Definition RecordManager.h:39
VRS stream identifier class.
Definition StreamId.h:251
The WriteFileHandler interface adds write operations to the FileHandler interface.
Definition WriteFileHandler.h:43
Definition Compressor.cpp:119
@ UNDEFINED
Unknown/unspecified.
CompressionType
Type of compression. Used in VRS record headers, so never modify the values.
Definition Record.h:39