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>
35class DirectWriteRecordData;
94 enum class Type : uint8_t {
112 uint32_t formatVersion,
114 uint64_t creationOrder);
117 void addDirectWriteRecordData(unique_ptr<DirectWriteRecordData>&& directWriteRecordData);
121 void addBorrowedData(unique_ptr<BorrowedData>&& borrowedData);
126 bool shouldTryToCompress()
const;
132 int compressRecord(
Compressor& compressor, uint32_t& outCompressedSize);
139 uint32_t& inOutRecordSize,
141 uint32_t compressedSize);
148 uint64_t getCreationOrder()
const {
149 return creationOrder_;
154 return usedBufferSize_;
163 static const char* typeName(Type type);
174 uint32_t formatVersion_{};
175 helpers::IOVector<uint8_t> buffer_;
176 std::vector<DataSlice> compressorDataSlices_;
177 size_t usedBufferSize_{};
179 uint64_t creationOrder_{};
180 unique_ptr<DirectWriteRecordData> directWriteRecordData_;
181 unique_ptr<BorrowedData> borrowedData_;
183 RecordManager& recordManager_;
Helper class to compress data using lz4 or zstd presets.
Definition Compressor.h:83
A class referencing data to be captured in a record at creation.
Definition DataSource.h:154
Essential VRS class holding a record's details and payload in memory during creation.
Definition Record.h:85
Type getRecordType() const
Get the record's record type.
Definition Record.h:158
Type
Definition Record.h:94
double getTimestamp() const
Get the record's timestamp.
Definition Record.h:144
static const double kMaxTimestamp
Maximum timestamp for a record.
Definition Record.h:88
size_t getSize() const
Get the record's payload size, uncompressed.
Definition Record.h:153
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:129
@ UNDEFINED
Unknown/unspecified.
CompressionType
Type of compression. Used in VRS record headers, so never modify the values.
Definition Record.h:41