ImFusion C++ SDK 4.4.0
ImFusion::CompoundStreamData Class Reference

#include <ImFusion/Stream/CompoundStreamData.h>

Container for StreamData from the individual Streams of a StreamGroup. More...

Detailed Description

Container for StreamData from the individual Streams of a StreamGroup.

CompoundStreamData bundles the StreamData from a proxy stream and its substreams into a single object, enabling receivers to process data from all streams at once. This is particularly useful for multi-sensor systems where data from multiple sources needs to be handled together (e.g., synchronized camera and tracking data).

The StreamGroup takes care of distributing the CompoundStreamData via StreamGroupBase::signalNewStreamGroupData, while simultaneously emitting individual StreamData to each stream's Stream::signalStreamData. This dual emission strategy allows receivers to either process all streams together or handle individual streams independently.

Usage example in a StreamGroup with a proxy stream of type TrackingStream and a substream of type ImageSubstream:

// In a StreamGroup's doWork() method
auto proxyData = std::make_shared<TrackingStreamData>(this, trackingData);
auto imageData = std::make_shared<ImageStreamData>(substreams()[0], imageData);
auto compound = std::make_shared<CompoundStreamData>(proxyData, std::vector{imageData});
emitMainAndSubSignals(compound);
T make_shared(T... args)
See also
StreamGroup, StreamGroupBase, StreamData

Public Member Functions

 CompoundStreamData (std::shared_ptr< const StreamData > proxyStreamData, std::vector< std::shared_ptr< const StreamData > > substreamsStreamData)
 Constructs a CompoundStreamData object with StreamData for the proxy stream and its substreams.
std::shared_ptr< const StreamDataproxyStreamData () const
 Returns the StreamData from the proxy stream, or nullptr if the proxy stream does not produce its own StreamData (e.g., when using Stream as the base class rather than a specialized type).
std::vector< std::shared_ptr< const StreamData > > substreamsStreamData () const
 Returns all available StreamData of the substreams.

Protected Attributes

std::shared_ptr< const StreamDatam_proxyStreamData = nullptr
 StreamData from the proxy stream (may be nullptr).
std::vector< std::shared_ptr< const StreamData > > m_substreamsStreamData
 StreamData from the substreams (may be a subset of the substreams).

Constructor & Destructor Documentation

◆ CompoundStreamData()

ImFusion::CompoundStreamData::CompoundStreamData ( std::shared_ptr< const StreamData > proxyStreamData,
std::vector< std::shared_ptr< const StreamData > > substreamsStreamData )
explicit

Constructs a CompoundStreamData object with StreamData for the proxy stream and its substreams.

Parameters
proxyStreamDataStreamData from the proxy stream. May be nullptr for a StreamGroup where the proxy stream is of the base class type Stream and does not produce its own specialized StreamData.
substreamsStreamDataVector of StreamData from the substreams. May contain StreamData for all or any subset of the substreams, depending on which streams have data available at the time of emission.

Member Function Documentation

◆ substreamsStreamData()

std::vector< std::shared_ptr< const StreamData > > ImFusion::CompoundStreamData::substreamsStreamData ( ) const

Returns all available StreamData of the substreams.

Not guaranteed to contain StreamData for all substreams; any subset is valid depending on which streams have data available.


The documentation for this class was generated from the following file:
  • ImFusion/Stream/CompoundStreamData.h
Search Tab / S to search, Esc to close