Handler object for a single stream. More...
#include <cvb/async/single_stream_handler.hpp>
Inherits MultiStreamHandler.
Static Public Member Functions | |
static std::unique_ptr< SingleStreamHandler > | Create (const Driver::StreamPtr &stream) |
Create a stream handler object. More... | |
Static Public Member Functions inherited from MultiStreamHandler | |
static std::unique_ptr< MultiStreamHandler > | Create (const std::vector< Driver::StreamPtr > &streamVector) |
Create a stream handler object. More... | |
Static Public Member Functions inherited from StreamHandlerBase< Stream > | |
static std::unique_ptr< StreamHandlerBase > | Create (const StreamVectorType &streamVector) |
Create a stream handler object. More... | |
static std::unique_ptr< StreamHandlerBase > | Create (const StreamPtrType &stream) |
Create a stream handler object. More... | |
Protected Member Functions | |
virtual void | HandleAsyncStream (const Driver::StreamPtr &stream) |
Asynchronously called for the registered stream. More... | |
virtual void | HandleAsyncWaitResult (const Driver::StreamImagePtr &streamImage, WaitStatus waitStatus) |
Asynchronously called for an acquired images. More... | |
virtual void | Setup (const Driver::StreamPtr &stream) |
Setup the stream for acquisition. More... | |
virtual void | TearDown (const Driver::StreamPtr &stream) noexcept |
Tear down the stream after acquisition. More... | |
SingleStreamHandler (const Driver::StreamPtr &stream) | |
Creates a stream handler object. More... | |
StreamPtr | Stream () const noexcept |
Get the stream associated with this handler. More... | |
Protected Member Functions inherited from MultiStreamHandler | |
MultiStreamHandler (const std::vector< Driver::StreamPtr > &streamVector) | |
Creates a stream handler object. More... | |
Protected Member Functions inherited from StreamHandlerBase< Stream > | |
StreamHandlerBase (const StreamVectorType &streamVector) | |
Creates a stream handler object. More... | |
StreamHandlerBase (const StreamPtrType &stream) | |
Creates a stream handler object. More... | |
virtual void | HandleAsyncStream (const StreamVectorType &streamVector) |
Asynchronously called for all registered streams. More... | |
virtual void | HandleAsyncWaitResult (const std::vector< WaitResult< typename Internal::DeliverableTraits< Stream >::type > > &waitResultVector) |
Asynchronously called for all acquired images. More... | |
virtual void | HandleAsyncWaitResult (const std::vector< WaitResultTuple< typename Internal::DeliverableTraits< Stream >::type > > &waitResultVector) |
Asynchronously called for all acquired images. More... | |
virtual void | Setup (const StreamVectorType streamVector) |
Setup the streams for acquisition. More... | |
virtual void | TearDown (const StreamVectorType streamVector) noexcept |
Tear down the streams after acquisition. More... | |
virtual void | HandleError (const std::exception &error) noexcept |
Handles standard exceptions in the acquisition thread. More... | |
virtual void | Begin () noexcept |
Performs custom operations at the beginning of the acquisition thread. More... | |
virtual void | End () noexcept |
Performs custom operations just before the end of the acquisition thread. More... | |
std::vector< StreamPtrType > | StreamVector () const noexcept |
Get the streams associated with this handler. More... | |
Additional Inherited Members | |
Public Types inherited from StreamHandlerBase< Stream > | |
using | StreamType = Stream |
Shorthand notation of the stream type. | |
using | StreamPtrType = std::shared_ptr< StreamType > |
Shorthand notation of the shared pointer of the specified stream. | |
using | StreamVectorType = std::vector< StreamPtrType > |
Shorthand notation of the container of the stream shared pointer. | |
using | DeliverableType = typename Internal::DeliverableTraits< Stream >::type |
Shorthand notation of the stream deliverable type of the specified stream. | |
using | DeliverablePtrType = std::shared_ptr< typename Internal::DeliverableTraits< Stream >::type > |
Shorthand notation of the shared pointer of the stream deliverable. | |
using | DeliverablePtrVectorType = std::vector< DeliverablePtrType > |
Shorthand notation of the container of the stream deliverable shared pointers. | |
using | EventHandlerType = std::function< void(DeliverablePtrType, Cvb::WaitStatus)> |
Shorthand notation of the event handler, a callable, type. | |
using | EventHandlerVectorType = std::vector< EventHandlerType > |
Shorthand notation of the container of the event handler. | |
Public Member Functions inherited from StreamHandlerBase< Stream > | |
void | Run () |
Start the handler. More... | |
bool | TryFinish () noexcept |
Stop the handler. More... | |
void | Finish () |
Stop the handler. More... | |
bool | IsActive () const noexcept |
Check if the acquisition thread is running. More... | |
Handler object for a single stream.
This handler provides a convenient way to acquire images from a single stream within a dedicated thread.
For a multiple synchronous stream see MultiStreamHandler.
|
inlineexplicitprotected |
Creates a stream handler object.
[in] | stream | Stream to handle. |
Any | exception derived from std::exception including CvbException. |
Call this in a customized subclass to setup the handler.
|
inlinestatic |
Create a stream handler object.
[in] | stream | Stream to handle. |
Any | exception derived from std::exception including CvbException. |
|
inlineprotectedvirtual |
Asynchronously called for the registered stream.
[in] | stream | Stream to handle (provided at creation). |
Any | exception derived from std::exception including CvbException. |
The default implementation just waits for the next image.
|
inlineprotectedvirtual |
Asynchronously called for an acquired images.
[in] | streamImage | The image if wait was successful. |
[in] | waitStatus | Status for the wait operation. |
Any | exception derived from std::exception including CvbException. The default implementation does nothing. |
|
inlineprotectedvirtual |
Setup the stream for acquisition.
[in] | stream | Stream to handle (provided at creation). |
Any | exception derived from std::exception including CvbException. |
The default implementation just calls Stream::Start().
|
inlineprotectednoexcept |
Get the stream associated with this handler.
Does | not throw any exception. |
|
inlineprotectedvirtualnoexcept |
Tear down the stream after acquisition.
[in] | stream | Stream to handle (provided at creation). |
Any | exception derived from std::exception including CvbException. |
The default implemntation just calls Stream::TryAbort().