Handler object for multiple synchronous streams. More...
#include <cvb/async/multi_stream_handler.hpp>
Inherits StreamHandlerBase< Stream >.
Inherited by SingleStreamHandler.
Static Public Member Functions | |
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 | |
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 multiple synchronous streams.
This handler provides a convenient way to acquire images from multiple synchronous streams within a dedicated thread. All streams for this handler must be synchronously (exactly the same frame rate). If this is not the case you will loose images. Please be aware, that there is no way for the application to verify, that the streams are synchronized. For multiple devices usually an external electrical synchronizations mechanism is provided.
For a single stream see SingleStreamHandler.
|
inlineexplicitprotected |
Creates a stream handler object.
[in] | streamVector | List with synchronous streams. |
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] | streamVector | List with synchronous streams. |
Any | exception derived from std::exception including CvbException. |