![]() |
ImFusion C++ SDK 4.4.0
|
#include <ImFusion/Stream/SubstreamWrapper.h>
Generic wrapper to integrate an existing Stream into a StreamGroup as a substream. More...
Generic wrapper to integrate an existing Stream into a StreamGroup as a substream.
SubstreamWrapper takes ownership of an independent Stream and adds substream functionality, enabling it to be bundled into a StreamGroup. Unlike the Substream template class which creates dummy substreams fully controlled by the proxy stream, SubstreamWrapper preserves the wrapped stream's own implementation and doWork() execution.
The wrapper handles bidirectional state synchronization between the wrapped stream and the proxy stream:
Use cases:
Example usage:
Public Member Functions | |
| SubstreamWrapper (std::unique_ptr< Stream > stream, StreamGroupBase *streamGroup) | |
| Constructs a SubstreamWrapper for the given stream to become a substream of the stream group streamGroup. | |
| ~SubstreamWrapper () | |
| Disconnects state synchronization signals, blocks the wrapped stream's data emission, and ensures the stream is properly closed. | |
| Stream * | stream () override |
| Returns the wrapped stream, valid for the lifetime of this wrapper. | |
| Public Member Functions inherited from ImFusion::SubstreamBase | |
| SubstreamBase (StreamGroupBase *streamGroup) | |
| Constructs a substream associated with the owning stream group. | |
| StreamGroupBase * | streamGroup () const |
| Returns the stream group this substream belongs to. | |
Additional Inherited Members | |
| Protected Attributes inherited from ImFusion::SubstreamBase | |
| StreamGroupBase * | m_streamGroup = nullptr |
| ImFusion::SubstreamWrapper::SubstreamWrapper | ( | std::unique_ptr< Stream > | stream, |
| StreamGroupBase * | streamGroup ) |
Constructs a SubstreamWrapper for the given stream to become a substream of the stream group streamGroup.
Takes ownership of the stream and sets up synchronization of its initial state with the proxy stream
|
overridevirtual |
Returns the wrapped stream, valid for the lifetime of this wrapper.
Implements ImFusion::SubstreamBase.