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... | |
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).
|
inlineexplicitnoexcept |
Creates a stream handler guard object.
[in] | streamHandler | Stream handler shared by the guard. |
[in] | autoRun | Run the stream handler if yes and not already running, otherwise do nothing. |
Does | not throw any exception. |
|
inline |
Finishes the shared stream handler .
Does | not throw any exception. |
All errors occurred within the acquisition thread are shallowed.