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. | |
![]() | |
static std::unique_ptr< MultiStreamHandler > | Create (const std::vector< Driver::StreamPtr > &streamVector) |
Create a stream handler object. | |
![]() | |
static std::unique_ptr< StreamHandlerBase > | Create (const StreamVectorType &streamVector) |
Create a stream handler object. | |
static std::unique_ptr< StreamHandlerBase > | Create (const StreamPtrType &stream) |
Create a stream handler object. | |
static std::unique_ptr< StreamHandlerBase > | Create (const StreamVectorType &streamVector) |
Create a stream handler object. | |
static std::unique_ptr< StreamHandlerBase > | Create (const StreamPtrType &stream) |
Create a stream handler object. | |
static std::unique_ptr< StreamHandlerBase > | Create (const StreamVectorType &streamVector) |
Create a stream handler object. | |
static std::unique_ptr< StreamHandlerBase > | Create (const StreamPtrType &stream) |
Create a stream handler object. | |
static std::unique_ptr< StreamHandlerBase > | Create (const StreamVectorType &streamVector) |
Create a stream handler object. | |
static std::unique_ptr< StreamHandlerBase > | Create (const StreamPtrType &stream) |
Create a stream handler object. | |
Protected Member Functions | |
virtual void | HandleAsyncStream (const Driver::StreamPtr &stream) |
Asynchronously called for the registered stream. | |
virtual void | HandleAsyncWaitResult (const Driver::StreamImagePtr &streamImage, WaitStatus waitStatus) |
Asynchronously called for an acquired images. | |
virtual void | Setup (const Driver::StreamPtr &stream) |
Setup the stream for acquisition. | |
virtual void | TearDown (const Driver::StreamPtr &stream) noexcept |
Tear down the stream after acquisition. | |
SingleStreamHandler (const Driver::StreamPtr &stream) | |
Creates a stream handler object. | |
StreamPtr | Stream () const noexcept |
Get the stream associated with this handler. | |
![]() | |
MultiStreamHandler (const std::vector< Driver::StreamPtr > &streamVector) | |
Creates a stream handler object. | |
![]() | |
virtual void | HandleAsyncStream (const StreamVectorType &streamVector) |
Asynchronously called for all registered streams. | |
virtual void | HandleAsyncWaitResult (const std::vector< WaitResultTuple< typename Internal::DeliverableTraits< Stream >::type > > &waitResultVector) |
Asynchronously called for all acquired images. | |
virtual void | Setup (const StreamVectorType streamVector) |
Setup the streams for acquisition. | |
virtual void | TearDown (const StreamVectorType streamVector) noexcept |
Tear down the streams after acquisition. | |
virtual void | HandleError (const std::exception &error) noexcept |
Handles standard exceptions in the acquisition thread. | |
virtual void | Begin () noexcept |
Performs custom operations at the beginning of the acquisition thread. | |
virtual void | End () noexcept |
Performs custom operations just before the end of the acquisition thread. | |
StreamHandlerBase (const StreamVectorType &streamVector) | |
Creates a stream handler object. | |
StreamHandlerBase (const StreamPtrType &stream) | |
Creates a stream handler object. | |
std::vector< StreamPtrType > | StreamVector () const noexcept |
Get the streams associated with this handler. | |
StreamHandlerBase (const StreamVectorType &streamVector) | |
Creates a stream handler object. | |
StreamHandlerBase (const StreamPtrType &stream) | |
Creates a stream handler object. | |
virtual void | HandleAsyncStream (const StreamVectorType &streamVector) |
Asynchronously called for all registered streams. | |
virtual void | HandleAsyncWaitResult (const std::vector< WaitResult< typename Internal::DeliverableTraits< Stream >::type > > &waitResultVector) |
Asynchronously called for all acquired images. | |
virtual void | HandleAsyncWaitResult (const std::vector< WaitResultTuple< typename Internal::DeliverableTraits< Stream >::type > > &waitResultVector) |
Asynchronously called for all acquired images. | |
virtual void | Setup (const StreamVectorType streamVector) |
Setup the streams for acquisition. | |
virtual void | TearDown (const StreamVectorType streamVector) noexcept |
Tear down the streams after acquisition. | |
virtual void | HandleError (const std::exception &error) noexcept |
Handles standard exceptions in the acquisition thread. | |
virtual void | Begin () noexcept |
Performs custom operations at the beginning of the acquisition thread. | |
virtual void | End () noexcept |
Performs custom operations just before the end of the acquisition thread. | |
std::vector< StreamPtrType > | StreamVector () const noexcept |
Get the streams associated with this handler. | |
StreamHandlerBase (const StreamVectorType &streamVector) | |
Creates a stream handler object. | |
StreamHandlerBase (const StreamPtrType &stream) | |
Creates a stream handler object. | |
virtual void | HandleAsyncStream (const StreamVectorType &streamVector) |
Asynchronously called for all registered streams. | |
virtual void | HandleAsyncWaitResult (const std::vector< WaitResult< typename Internal::DeliverableTraits< Stream >::type > > &waitResultVector) |
Asynchronously called for all acquired images. | |
virtual void | HandleAsyncWaitResult (const std::vector< WaitResultTuple< typename Internal::DeliverableTraits< Stream >::type > > &waitResultVector) |
Asynchronously called for all acquired images. | |
virtual void | Setup (const StreamVectorType streamVector) |
Setup the streams for acquisition. | |
virtual void | TearDown (const StreamVectorType streamVector) noexcept |
Tear down the streams after acquisition. | |
virtual void | HandleError (const std::exception &error) noexcept |
Handles standard exceptions in the acquisition thread. | |
virtual void | Begin () noexcept |
Performs custom operations at the beginning of the acquisition thread. | |
virtual void | End () noexcept |
Performs custom operations just before the end of the acquisition thread. | |
std::vector< StreamPtrType > | StreamVector () const noexcept |
Get the streams associated with this handler. | |
StreamHandlerBase (const StreamVectorType &streamVector) | |
Creates a stream handler object. | |
StreamHandlerBase (const StreamPtrType &stream) | |
Creates a stream handler object. | |
virtual void | HandleAsyncStream (const StreamVectorType &streamVector) |
Asynchronously called for all registered streams. | |
virtual void | HandleAsyncWaitResult (const std::vector< WaitResult< typename Internal::DeliverableTraits< Stream >::type > > &waitResultVector) |
Asynchronously called for all acquired images. | |
virtual void | HandleAsyncWaitResult (const std::vector< WaitResultTuple< typename Internal::DeliverableTraits< Stream >::type > > &waitResultVector) |
Asynchronously called for all acquired images. | |
virtual void | Setup (const StreamVectorType streamVector) |
Setup the streams for acquisition. | |
virtual void | TearDown (const StreamVectorType streamVector) noexcept |
Tear down the streams after acquisition. | |
virtual void | HandleError (const std::exception &error) noexcept |
Handles standard exceptions in the acquisition thread. | |
virtual void | Begin () noexcept |
Performs custom operations at the beginning of the acquisition thread. | |
virtual void | End () noexcept |
Performs custom operations just before the end of the acquisition thread. | |
std::vector< StreamPtrType > | StreamVector () const noexcept |
Get the streams associated with this handler. | |
Additional Inherited Members | |
![]() | |
using | StreamType |
Shorthand notation of the stream type. | |
using | StreamPtrType |
Shorthand notation of the shared pointer of the specified stream. | |
using | StreamVectorType |
Shorthand notation of the container of the stream shared pointer. | |
using | DeliverableType |
Shorthand notation of the stream deliverable type of the specified stream. | |
using | DeliverablePtrType |
Shorthand notation of the shared pointer of the stream deliverable. | |
using | DeliverablePtrVectorType |
Shorthand notation of the container of the stream deliverable shared pointers. | |
using | EventHandlerType |
Shorthand notation of the event handler, a callable, type. | |
using | EventHandlerVectorType |
Shorthand notation of the container of the event handler. | |
using | StreamType |
Shorthand notation of the stream type. | |
using | StreamPtrType |
Shorthand notation of the shared pointer of the specified stream. | |
using | StreamVectorType |
Shorthand notation of the container of the stream shared pointer. | |
using | DeliverableType |
Shorthand notation of the stream deliverable type of the specified stream. | |
using | DeliverablePtrType |
Shorthand notation of the shared pointer of the stream deliverable. | |
using | DeliverablePtrVectorType |
Shorthand notation of the container of the stream deliverable shared pointers. | |
using | EventHandlerType |
Shorthand notation of the event handler, a callable, type. | |
using | EventHandlerVectorType |
Shorthand notation of the container of the event handler. | |
using | StreamType |
Shorthand notation of the stream type. | |
using | StreamPtrType |
Shorthand notation of the shared pointer of the specified stream. | |
using | StreamVectorType |
Shorthand notation of the container of the stream shared pointer. | |
using | DeliverableType |
Shorthand notation of the stream deliverable type of the specified stream. | |
using | DeliverablePtrType |
Shorthand notation of the shared pointer of the stream deliverable. | |
using | DeliverablePtrVectorType |
Shorthand notation of the container of the stream deliverable shared pointers. | |
using | EventHandlerType |
Shorthand notation of the event handler, a callable, type. | |
using | EventHandlerVectorType |
Shorthand notation of the container of the event handler. | |
![]() | |
void | Run () |
Start the handler. | |
bool | TryFinish () noexcept |
Stop the handler. | |
void | Finish () |
Stop the handler. | |
bool | IsActive () const noexcept |
Check if the acquisition thread is running. | |
void | Run () |
Start the handler. | |
bool | TryFinish () noexcept |
Stop the handler. | |
void | Finish () |
Stop the handler. | |
bool | IsActive () const noexcept |
Check if the acquisition thread is running. | |
void | Run () |
Start the handler. | |
bool | TryFinish () noexcept |
Stop the handler. | |
void | Finish () |
Stop the handler. | |
bool | IsActive () const noexcept |
Check if the acquisition thread is running. | |
void | Run () |
Start the handler. | |
bool | TryFinish () noexcept |
Stop the handler. | |
void | Finish () |
Stop the handler. | |
bool | IsActive () const noexcept |
Check if the acquisition thread is running. | |
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().
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().
We use cookies to improve your experience. By using this documentation, you agree to our use of cookies.