PicoScenes API Docs
 
Loading...
Searching...
No Matches
FrameDumper Class Reference

Class for dumping PicoScenes frames to files. More...

#include <FrameDumper.hxx>

Public Member Functions

int dumpData (const uint8_t *buffer, const size_t msg_len)
 Dump raw data buffer to file.
 
void dumpData (const std::vector< uint8_t > &buffer)
 Dump vector data to file.
 
void dumpRxFrame (const ModularPicoScenesRxFrame &rxFrame)
 Dump a PicoScenes RX frame to file.
 
void finishCurrentSession ()
 Finish current dump session.
 
 ~FrameDumper ()
 Destructor.
 

Static Public Member Functions

static std::shared_ptr< FrameDumpergetInstance (const std::string &dumperName, bool withoutTime=false)
 Get or create a dumper instance with the specified name.
 
static std::shared_ptr< FrameDumpergetInstanceWithoutTime (const std::string &dumperName)
 Get or create a dumper instance without timestamp in filename.
 
static void finishAllSessions ()
 Finish all active dump sessions.
 

Detailed Description

Class for dumping PicoScenes frames to files.

This class implements a singleton pattern for managing frame dumps. It provides functionality to:

  • Create named dumper instances
  • Write frame data to files
  • Manage dump sessions
  • Support concurrent access through thread-safe operations

Definition at line 22 of file FrameDumper.hxx.

Constructor & Destructor Documentation

◆ ~FrameDumper()

FrameDumper::~FrameDumper ( )

Destructor.

Ensures proper cleanup by finishing the current session

Member Function Documentation

◆ dumpData() [1/2]

void FrameDumper::dumpData ( const std::vector< uint8_t > &  buffer)

Dump vector data to file.

Parameters
bufferVector containing data to dump

◆ dumpData() [2/2]

int FrameDumper::dumpData ( const uint8_t *  buffer,
const size_t  msg_len 
)

Dump raw data buffer to file.

Parameters
bufferPointer to data buffer
msg_lenLength of data in bytes
Returns
0 on success
Exceptions
std::runtime_errorIf file cannot be opened for writing

◆ dumpRxFrame()

void FrameDumper::dumpRxFrame ( const ModularPicoScenesRxFrame &  rxFrame)

Dump a PicoScenes RX frame to file.

Parameters
rxFrameReference to the frame to dump

◆ finishAllSessions()

static void FrameDumper::finishAllSessions ( )
static

Finish all active dump sessions.

Static method to close all open dumper instances

◆ finishCurrentSession()

void FrameDumper::finishCurrentSession ( )

Finish current dump session.

Closes the file and cleans up resources for this dumper instance

◆ getInstance()

static std::shared_ptr< FrameDumper > FrameDumper::getInstance ( const std::string &  dumperName,
bool  withoutTime = false 
)
static

Get or create a dumper instance with the specified name.

Parameters
dumperNameName identifier for the dumper
withoutTimeIf true, omits timestamp from filename (default: false)
Returns
Shared pointer to the dumper instance

◆ getInstanceWithoutTime()

static std::shared_ptr< FrameDumper > FrameDumper::getInstanceWithoutTime ( const std::string &  dumperName)
static

Get or create a dumper instance without timestamp in filename.

Parameters
dumperNameName identifier for the dumper
Returns
Shared pointer to the dumper instance

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