22#include <vrs/helpers/EnumTemplates.hpp>
24#include "ForwardDefinitions.h"
30class DirectWriteRecordData;
88 enum class Type : uint8_t {
106 uint32_t formatVersion,
108 uint64_t creationOrder);
128 uint32_t& inOutRecordSize,
130 uint32_t compressedSize);
137 uint64_t getCreationOrder()
const {
138 return creationOrder_;
143 return usedBufferSize_;
170 uint32_t formatVersion_{};
171 std::vector<uninitialized_byte> buffer_;
172 size_t usedBufferSize_{};
173 uint64_t creationOrder_{};
174 std::unique_ptr<DirectWriteRecordData> directWriteRecordData_;
176 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:79
static const char * typeName(Type type)
Get a record type as a text string.
Definition Record.cpp:158
int writeRecord(WriteFileHandler &file, StreamId streamId, uint32_t &inOutRecordSize, Compressor &compressor, uint32_t compressedSize)
Definition Record.cpp:113
Type getRecordType() const
Get the record's record type.
Definition Record.h:147
Type
Definition Record.h:88
@ 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:105
void addDirectWriteRecordData(std::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:95
double getTimestamp() const
Get the record's timestamp.
Definition Record.h:133
static const double kMaxTimestamp
Maximum timestamp for a record.
Definition Record.h:82
size_t getSize() const
Get the record's payload size, uncompressed.
Definition Record.h:142
bool shouldTryToCompress() const
Definition Record.cpp:100
void recycle()
Definition Record.cpp:66
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:242
The WriteFileHandler interface adds write operations to the FileHandler interface.
Definition WriteFileHandler.h:45
Definition AsyncDiskFileChunk.hpp:49
CompressionType
Type of compression. Used in VRS record headers, so never modify the values.
Definition Record.h:35
CachingStrategy toEnum(const string &name)
Convert a record type name into an enum value.
Definition FileHandler.cpp:131
Public for testing.
Definition Record.h:155