CVB++ 14.0
StreamHandlerGuard Class Referencefinal

Handler guard object to safely run and finish a stream handler. More...

#include <cvb/async/multi_stream_handler.hpp>

Public Member Functions

 StreamHandlerGuard (const Cvb::MultiStreamHandlerPtr &streamHandler, AutoRun autoRun=AutoRun::No) noexcept
 Creates a stream handler guard object. More...
 
 ~StreamHandlerGuard ()
 Finishes the shared stream handler . More...
 

Detailed Description

Handler guard object to safely run and finish a stream handler.

This guard class provides a way to safely stop the stream when leaving the scope (e.g an exception occurs).

Examples
Cvb/QmlStreamDisplay, and Cvb/QtStreamDisplay.

Constructor & Destructor Documentation

◆ StreamHandlerGuard()

StreamHandlerGuard ( const Cvb::MultiStreamHandlerPtr &  streamHandler,
AutoRun  autoRun = AutoRun::No 
)
inlineexplicitnoexcept

Creates a stream handler guard object.

Parameters
[in]streamHandlerStream handler shared by the guard.
[in]autoRunRun the stream handler if yes and not already running, otherwise do nothing.
Exceptions
Doesnot throw any exception.

◆ ~StreamHandlerGuard()

~StreamHandlerGuard ( )
inline

Finishes the shared stream handler .

Exceptions
Doesnot throw any exception.

All errors occurred within the acquisition thread are shallowed.