ImFusion C++ SDK 4.4.0
ImFusion::StreamGroupBase Class Referenceabstract

#include <ImFusion/Stream/StreamGroupBase.h>

Non-templated base class for stream groups. More...

Inheritance diagram for ImFusion::StreamGroupBase:

Detailed Description

Non-templated base class for stream groups.

StreamGroupBase provides a structure for bundling multiple related streams into a single logical unit. It manages a proxy stream (the representative and controller) and an arbitrary number of substreams, coordinating their lifecycle and data emission.

The stream group appears as CompoundData in the data model, with the proxy stream acting as the representative Concrete implementations should use the StreamGroup template class rather than directly inheriting from StreamGroupBase.

See also
StreamGroup, SubstreamBase, CompoundStreamData

Public Member Functions

virtual StreamproxyStream ()=0
 Returns the proxy stream representative that controls this stream group.
virtual std::vector< Stream * > substreams () const =0
 Returns all substreams in this stream group.
Public Member Functions inherited from ImFusion::CompoundData
virtual DataList children () const =0
 Returns the list of direct children of this group.
Public Member Functions inherited from ImFusion::SignalReceiver
 SignalReceiver ()=default
 Default constructor.
 SignalReceiver (const SignalReceiver &other)
 Copy constructor, does not copy any existing signal connections from other.
SignalReceiveroperator= (SignalReceiver rhs)
 Assignment operator, disconnects all existing connections, does not copy any existing signal connections from rhs.
virtual ~SignalReceiver ()
 Virtual destructor disconnects from all connected signals.

Public Attributes

ProtectedSignal< std::shared_ptr< const CompoundStreamData > > signalNewStreamGroupData
 Signal emitted when new stream data is available from the stream group.
Public Attributes inherited from ImFusion::CompoundData
Signal< Data * > signalChildAdded
 Signal emitted when a new Data instance has been added to children().
Signal< Data * > signalChildMoved
 Signal emitted when a Data instance has changed its position in children().
Signal< Data * > signalChildAboutToBeRemoved
 Signal emitted when a Data instance is about to be removed or taken from children().

Protected Member Functions

virtual bool addSubstream (std::unique_ptr< SubstreamBase > substream)=0
 Adds a substream to the stream group.
virtual bool removeSubstream (Stream *substream)=0
 Removes a substream from the stream group.
void reassignSubstream (SubstreamBase *substream)
 Reassigns a substream to this stream group.
Protected Member Functions inherited from ImFusion::Utils::NotCopyable
 NotCopyable (NotCopyable &&) noexcept=default
NotCopyable & operator= (NotCopyable &&) noexcept=default
 NotCopyable (const NotCopyable &)=delete
NotCopyable & operator= (const NotCopyable &)=delete
Protected Member Functions inherited from ImFusion::SignalReceiver
void disconnectAll ()
 Disconnects all existing connections.

Member Function Documentation

◆ proxyStream()

virtual Stream * ImFusion::StreamGroupBase::proxyStream ( )
pure virtual

Returns the proxy stream representative that controls this stream group.

Typically, a cast of the stream group to the proxy stream class.

Implemented in ImFusion::StreamGroup< Proxy >, ImFusion::StreamGroup< AtracsysTrackingStreamBase >, and ImFusion::StreamGroup< StereoImageStream >.

◆ substreams()

virtual std::vector< Stream * > ImFusion::StreamGroupBase::substreams ( ) const
pure virtualthreadsafe

Returns all substreams in this stream group.

Warning
The returned vector represents a snapshot of the current substreams which may be outdated

Can be called concurrently from any thread.

Implemented in ImFusion::StreamGroup< Proxy >, ImFusion::StreamGroup< AtracsysTrackingStreamBase >, and ImFusion::StreamGroup< StereoImageStream >.

◆ addSubstream()

virtual bool ImFusion::StreamGroupBase::addSubstream ( std::unique_ptr< SubstreamBase > substream)
protectedpure virtualthreadsafe

Adds a substream to the stream group.

Ownership is transferred to the stream group. Returns true if the substream was added successfully, false otherwise.

Can be called concurrently from any thread.

Implemented in ImFusion::StreamGroup< Proxy >, ImFusion::StreamGroup< AtracsysTrackingStreamBase >, and ImFusion::StreamGroup< StereoImageStream >.

◆ removeSubstream()

virtual bool ImFusion::StreamGroupBase::removeSubstream ( Stream * substream)
protectedpure virtualthreadsafe

Removes a substream from the stream group.

The removal is thread-safe and may be invoked on the main thread if called from a worker thread.

Returns true if the substream was removed successfully, false if not found.

Can be called concurrently from any thread.

Implemented in ImFusion::StreamGroup< Proxy >, ImFusion::StreamGroup< AtracsysTrackingStreamBase >, and ImFusion::StreamGroup< StereoImageStream >.

◆ reassignSubstream()

void ImFusion::StreamGroupBase::reassignSubstream ( SubstreamBase * substream)
inlineprotected

Reassigns a substream to this stream group.

Used internally by the move operator to update substream ownership.

Member Data Documentation

◆ signalNewStreamGroupData

ProtectedSignal<std::shared_ptr<const CompoundStreamData> > ImFusion::StreamGroupBase::signalNewStreamGroupData

Signal emitted when new stream data is available from the stream group.

Emits CompoundStreamData containing the StreamData from the proxy stream and all substreams. This signal is emitted alongside individual Stream::signalStreamData emissions for each stream.

Connect to this signal when you need to process data from multiple streams simultaneously (e.g., synchronized image and tracking data).


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