![]() |
ImFusion SDK 4.3
|
#include <ImFusion/Stream/StreamGroup.h>
Templated stream group class to extend a proxy stream to a StreamGroup with the CRTP pattern. More...
Templated stream group class to extend a proxy stream to a StreamGroup with the CRTP pattern.
The proxy stream can be any class deriving from Stream (e.g., ImageStream, TrackingStream, etc.) or Stream itself. The StreamGroup handles an arbitrary set of Substream#s implementing the SubstreamBase interface, whereby the proxy stream owns and controls the substreams and may serve as representative of all streams. Substreams can be added, removed or moved at any time after construction.
Example implementation for a tracking stream with two image streams as substreams
Public Member Functions | |
StreamGroup (StreamGroup &&) noexcept | |
StreamGroup & | operator= (StreamGroup &&other) noexcept |
Stream * | proxyStream () override |
Convenience method to cast the stream group to the proxy stream. | |
DataList | children () const override |
Returns substreams as a non-owning data list implementing the CompoundData interface. | |
std::vector< Stream * > | substreams () const override |
Returns the substreams. | |
![]() | |
SignalReceiver ()=default | |
Default constructor. | |
SignalReceiver (const SignalReceiver &other) | |
Copy constructor, does not copy any existing signal connections from other. | |
SignalReceiver & | operator= (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. | |
Protected Member Functions | |
bool | addSubstream (std::unique_ptr< SubstreamBase > substream) override |
Adds a substream to the stream group. | |
bool | removeSubstream (Stream *substream) override |
Removes a substream from the stream group. | |
void | emitMainAndSubSignals (std::shared_ptr< const CompoundStreamData > tuple, bool emitSubstreamSignals=true) |
![]() | |
void | reassignSubstream (SubstreamBase *substream) |
Reassigns child to this (needed for move operator) | |
![]() | |
NotCopyable (NotCopyable &&) noexcept=default | |
NotCopyable & | operator= (NotCopyable &&) noexcept=default |
NotCopyable (const NotCopyable &)=delete | |
NotCopyable & | operator= (const NotCopyable &)=delete |
![]() | |
void | disconnectAll () |
Disconnects all existing connections. | |
Additional Inherited Members | |
![]() | |
ProtectedSignal< std::shared_ptr< const CompoundStreamData > > | signalNewStreamGroupData |
Signal contains all StreamData from the substreams. | |
![]() | |
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() | |
|
overridevirtual |
Convenience method to cast the stream group to the proxy stream.
Implements StreamGroupBase.
|
overridevirtual |
Returns substreams as a non-owning data list implementing the CompoundData interface.
See the documentation of substreams for details on thread safety.
Implements CompoundData.
|
overridevirtual |
Returns the substreams.
It is guaranteed that the substreams are not deleted within a doWork call until emitMainAndSubSignals has finished, even if some of the substreams are removed from the substream list already during the method execution. The following code is fully safe:
Implements StreamGroupBase.
|
overrideprotectedvirtual |
Adds a substream to the stream group.
Implements StreamGroupBase.
|
overrideprotectedvirtual |
Removes a substream from the stream group.
The removal is always executed on the main thread since the data model cannot handle removal calls from any other thread. If this method is called on another thread the actual removal is invoked on the main thread.
Implements StreamGroupBase.