22#include <vrs/ForwardDefinitions.h>
23#include <vrs/StreamId.h>
24#include <vrs/helpers/EnumTemplates.hpp>
32class DirectWriteRecordData;
90 enum class Type : uint8_t {
108 uint32_t formatVersion,
110 uint64_t creationOrder);
130 uint32_t& inOutRecordSize,
132 uint32_t compressedSize);
139 uint64_t getCreationOrder()
const {
140 return creationOrder_;
145 return usedBufferSize_;
172 uint32_t formatVersion_{};
173 vector<uninitialized_byte> buffer_;
174 size_t usedBufferSize_{};
175 uint64_t creationOrder_{};
176 unique_ptr<DirectWriteRecordData> directWriteRecordData_;
178 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:151
Essential VRS class holding a record's details and payload in memory during creation.
Definition Record.h:81
static const char * typeName(Type type)
Get a record type as a text string.
Definition Record.cpp:150
int writeRecord(WriteFileHandler &file, StreamId streamId, uint32_t &inOutRecordSize, Compressor &compressor, uint32_t compressedSize)
Definition Record.cpp:105
Type getRecordType() const
Get the record's record type.
Definition Record.h:149
Type
Definition Record.h:90
@ STATE
device or algorithm state information.
@ TAGS
tags record (VRS internal type).
@ COUNT
Count of enum values.
@ CONFIGURATION
device or algorithm configuration.
@ DATA
device or algorithm data.
uint32_t compressRecord(Compressor &compressor)
Definition Record.cpp:97
double getTimestamp() const
Get the record's timestamp.
Definition Record.h:135
static const double kMaxTimestamp
Maximum timestamp for a record.
Definition Record.h:84
size_t getSize() const
Get the record's payload size, uncompressed.
Definition Record.h:144
bool shouldTryToCompress() const
Definition Record.cpp:92
void addDirectWriteRecordData(unique_ptr< DirectWriteRecordData > &&directWriteRecordData)
Add some data to write directly at the end of the record when it's written to disk.
Definition Record.cpp:87
void recycle()
Definition Record.cpp:58
VRS internal class to manage the records of a specific Recordable after their creation.
Definition RecordManager.h:38
VRS stream identifier class.
Definition StreamId.h:249
The WriteFileHandler interface adds write operations to the FileHandler interface.
Definition WriteFileHandler.h:42
Definition Compressor.cpp:113
CompressionType
Type of compression. Used in VRS record headers, so never modify the values.
Definition Record.h:37
Public for testing.
Definition Record.h:157