OpenDaVINCI  4.16.0
odtools::recorder::Recorder Class Reference

#include <Recorder.h>

Public Member Functions

 Recorder (const string &url, const uint32_t &memorySegmentSize, const uint32_t &numberOfSegments, const bool &threading, const bool &dumpSharedData)
 
virtual ~Recorder ()
 
void recordQueueEntries ()
 
odcore::base::FIFOQueuegetFIFO ()
 
void registerRecorderDelegate (const uint32_t &containerID, RecorderDelegate *r)
 
SharedDataListenergetDataStoreForSharedData ()
 
void store (odcore::data::Container c)
 

Detailed Description

This class is the interface to use the recorder module from within other modules.s

Constructor & Destructor Documentation

odtools::recorder::Recorder::Recorder ( const string &  url,
const uint32_t &  memorySegmentSize,
const uint32_t &  numberOfSegments,
const bool &  threading,
const bool &  dumpSharedData 
)

Constructor.

Parameters
urlURL of the resource to be used for writing containers to.
memorySegmentSizeSize of a memory segment for storing shared memory data (like shared images).
numberOfSegmentsNumber of segments to be used.
threadingIf true recorder is using a background thread to dump shared memory data. If set to true recorder can be used in real-time required scenarios where it is embedded in user supplied apps; however, there is a risk that if the queue size (numberOfSegments) is chosen too small or the low-level disk I/O containers of type SharedImage or SharedMemory are dropped.
dumpSharedDataIf true, shared images and shared data will be stored as well.

References odcore::io::StreamFactory::getInstance(), odcore::io::StreamFactory::getOutputStream(), and odcore::io::URL::getResource().

odtools::recorder::Recorder::~Recorder ( )
virtual

References CLOG1, and recordQueueEntries().

Member Function Documentation

SharedDataListener & odtools::recorder::Recorder::getDataStoreForSharedData ( )

This method returns the data store to be used for storing shared memory.

Returns
Reference to data handler to be used for storing shared memory.

Referenced by store().

FIFOQueue & odtools::recorder::Recorder::getFIFO ( )

This method returns the FIFO to be used for all containers except for shared memory segments.

Returns
Reference to queue to be used for queuing Containers.

Referenced by store().

void odtools::recorder::Recorder::recordQueueEntries ( )

This method records data from the given FIFOQueue.

Parameters
fifoFIFOQueue to be used for recording data.

References odcore::data::Container::getDataType(), odcore::base::FIFOQueue::getSize(), odcore::base::FIFOQueue::isEmpty(), odcore::base::FIFOQueue::leave(), and odcore::data::Container::UNDEFINEDDATA.

Referenced by store(), and ~Recorder().

void odtools::recorder::Recorder::registerRecorderDelegate ( const uint32_t &  containerID,
RecorderDelegate r 
)

This method registers a RecorderDelegate to process a specific Container differently.

Parameters
containerIDContainer ID to listen for.
rRecorderDelegate.
void odtools::recorder::Recorder::store ( odcore::data::Container  c)

This method stores the given container. Depending on the container data type, either the FIFO queue is used or the one to handle shared memory data.

Parameters
cContainer to be recorded.

References odtools::recorder::SharedDataListener::add(), odcore::base::FIFOQueue::enter(), getDataStoreForSharedData(), odcore::data::Container::getDataType(), getFIFO(), recordQueueEntries(), and odcore::data::Container::UNDEFINEDDATA.