22#include <vrs/ForwardDefinitions.h>
23#include <vrs/StreamId.h>
24#include <vrs/VrsExport.h>
25#include <vrs/helpers/EnumTemplates.hpp>
33class DirectWriteRecordData;
91 enum class Type : uint8_t {
109 uint32_t formatVersion,
111 uint64_t creationOrder);
114 void addDirectWriteRecordData(unique_ptr<DirectWriteRecordData>&& directWriteRecordData);
119 bool shouldTryToCompress()
const;
124 uint32_t compressRecord(
Compressor& compressor);
131 uint32_t& inOutRecordSize,
133 uint32_t compressedSize);
140 uint64_t getCreationOrder()
const {
141 return creationOrder_;
146 return usedBufferSize_;
155 static const char* typeName(Type type);
173 uint32_t formatVersion_{};
174 vector<uninitialized_byte> buffer_;
175 size_t usedBufferSize_{};
176 uint64_t creationOrder_{};
177 unique_ptr<DirectWriteRecordData> directWriteRecordData_;
179 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:153
Essential VRS class holding a record's details and payload in memory during creation.
Definition Record.h:82
Type getRecordType() const
Get the record's record type.
Definition Record.h:150
Type
Definition Record.h:91
double getTimestamp() const
Get the record's timestamp.
Definition Record.h:136
static const double kMaxTimestamp
Maximum timestamp for a record.
Definition Record.h:85
size_t getSize() const
Get the record's payload size, uncompressed.
Definition Record.h:145
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:113
@ UNDEFINED
Unknown/unspecified.
CompressionType
Type of compression. Used in VRS record headers, so never modify the values.
Definition Record.h:38
Public for testing.
Definition Record.h:158