Voyant API 0.8.0
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
VoyantRecorder Class Reference

Class for recording Voyant frames to binary files with automatic splitting. More...

#include <voyant_data_recorder.hpp>

Public Member Functions

 VoyantRecorder (const VoyantRecorderConfig &config)
 Constructor that takes a configuration struct.
 
 ~VoyantRecorder ()
 Destructor - automatically finalizes recording if needed.
 
 VoyantRecorder (const VoyantRecorder &)=delete
 Non-copyable.
 
VoyantRecorderoperator= (const VoyantRecorder &)=delete
 
RecordResult recordFrame (const VoyantFrameWrapper &frame)
 Records a frame to the current file.
 
bool finalize ()
 Finalizes the recording and closes all files.
 
std::optional< size_t > getTotalFramesRecorded () const
 Gets the total number of frames recorded.
 
std::optional< size_t > getSplitCount () const
 Gets the number of file splits that have occurred.
 
bool isValid () const
 Checks if the recorder is valid.
 

Private Attributes

VoyantRecorderCrecorderHandle_
 
bool finalized_
 
std::string lastErrorMsg_
 
std::vector< uint8_t > buffer_
 

Detailed Description

Class for recording Voyant frames to binary files with automatic splitting.

Constructor & Destructor Documentation

◆ VoyantRecorder() [1/2]

VoyantRecorder::VoyantRecorder ( const VoyantRecorderConfig config)
explicit

Constructor that takes a configuration struct.

Parameters
configThe configuration settings for the recorder

◆ ~VoyantRecorder()

VoyantRecorder::~VoyantRecorder ( )

Destructor - automatically finalizes recording if needed.

◆ VoyantRecorder() [2/2]

VoyantRecorder::VoyantRecorder ( const VoyantRecorder )
delete

Non-copyable.

Member Function Documentation

◆ finalize()

bool VoyantRecorder::finalize ( )

Finalizes the recording and closes all files.

Returns
true if successful, false otherwise

◆ getSplitCount()

std::optional< size_t > VoyantRecorder::getSplitCount ( ) const

Gets the number of file splits that have occurred.

Returns
Number of splits, or std::nullopt if recorder is invalid

◆ getTotalFramesRecorded()

std::optional< size_t > VoyantRecorder::getTotalFramesRecorded ( ) const

Gets the total number of frames recorded.

Returns
Total frame count, or std::nullopt if recorder is invalid

◆ isValid()

bool VoyantRecorder::isValid ( ) const

Checks if the recorder is valid.

Returns
true if recorder is properly initialized

◆ operator=()

VoyantRecorder & VoyantRecorder::operator= ( const VoyantRecorder )
delete

◆ recordFrame()

RecordResult VoyantRecorder::recordFrame ( const VoyantFrameWrapper frame)

Records a frame to the current file.

Parameters
frameFrame to record
Returns
RecordResult indicating the outcome of the recording operation

Member Data Documentation

◆ buffer_

std::vector<uint8_t> VoyantRecorder::buffer_
private

◆ finalized_

bool VoyantRecorder::finalized_
private

◆ lastErrorMsg_

std::string VoyantRecorder::lastErrorMsg_
private

◆ recorderHandle_

VoyantRecorderC* VoyantRecorder::recorderHandle_
private

The documentation for this class was generated from the following file: