Public Member Functions | List of all members
CompositeStreamBase Class Reference

Base class of all composite based streams. More...

#include <cvb/driver/composite_stream_base.hpp>

Inherits StreamBase.

Inherited by CompositeStream, ImageStream, and PointCloudStream.

Public Member Functions

void * Handle () const noexcept
 Classic API stream handle. More...
 
virtual void EngineStart ()
 Starts the acquisition engine on the host. More...
 
virtual void EngineStart (std::int64_t bufferCountToAcquire)
 Starts the acquisition engine on the host. More...
 
template<class Rep , class Period >
void EngineStop (const std::chrono::duration< Rep, Period > &timeout)
 Stops the acquisition engine. More...
 
virtual void EngineStop ()
 Stops the acquisition engine. More...
 
template<class Rep , class Period >
bool TryEngineStop (const std::chrono::duration< Rep, Period > &timeout) noexcept
 Stops the acquisition engine. More...
 
virtual bool TryEngineStop () noexcept
 Stops the acquisition engine. More...
 
virtual bool TryEngineStop (const std::chrono::milliseconds &timeout) noexcept
 Stops the acquisition engine. More...
 
virtual void EngineAbort ()
 Stops the acquisition engine immediately. More...
 
virtual bool TryEngineAbort () noexcept
 Stops the acquisition engine immediately. More...
 
virtual void DeviceStart ()
 Starts the stream on the device. More...
 
virtual void DeviceStart (std::int64_t bufferCountToAcquire)
 Starts the stream on the device. More...
 
virtual void DeviceStop ()
 Stops the stream in the device. More...
 
virtual bool TryDeviceStop () noexcept
 Stops the stream in the device. More...
 
virtual void DeviceAbort ()
 Stops the stream in the device immediately. More...
 
virtual bool TryDeviceAbort () noexcept
 Stops the stream in the device immediately. More...
 
void DeregisterFlowSetPool ()
 Removes an existing flow set pool from the acquisition engine. More...
 
void RegisterManagedFlowSetPool (int flowSetCount)
 Registers an internal flows set pool. More...
 
void RegisterExternalFlowSetPool (FlowSetPoolPtr flowSetPoolPtr)
 Registers external memory. More...
 
void RegisterExternalFlowSetPool (FlowSetPoolPtr flowSetPoolPtr, std::function< void()> releaseCallback)
 Registers external memory. More...
 
int FlowSetCount () const noexcept
 Gets the number of registered flow sets. More...
 
int MinRequiredFlowSetCount () const
 Gets minimum number of flow sets required for the acquisition. More...
 
Cvb::Driver::AcquisitionInterface AcquisitionInterface () const noexcept override
 Gets the interface of this implementation. More...
 
void Start () override
 Starts the acquisition. More...
 
void Stop () override
 Stops the acquisition. More...
 
bool TryStop () noexcept override
 Stops the acquisition. More...
 
void Abort () override
 Stops the acquisition of images immediately. More...
 
bool TryAbort () noexcept override
 Stops the acquisition of images immediately. More...
 
bool IsIndexed () const noexcept override
 Gets whether this stream is an indexed stream. More...
 
Cvb::AcquisitionState AcquisitionState () const noexcept
 Gets the current acquisition state. More...
 
std::vector< FlowInfoFlowSetInfo () const
 Gets the flow set info of this stream. More...
 
NodeMapPtr NodeMap (const String &name) const
 Gets the NodeMap with the given name. More...
 
std::map< String, NodeMapPtr > NodeMaps () const
 Gets the dictionary holding all available stream NodeMaps. More...
 
- Public Member Functions inherited from StreamBase
DevicePtr Parent () const noexcept
 Gets the parent device of this stream. More...
 

Detailed Description

Base class of all composite based streams.

Member Function Documentation

◆ Abort()

void Abort ( )
inlineoverridevirtual

Stops the acquisition of images immediately.

Exceptions
Anyexception derived from std::exception including CvbException.

This stops the acquisition as fast as possible interrupting the ongoing operation. This might result in partially acquired images. The acquisition is stopped in the device first, then the engine on the host is stopped.

If the underlying driver does not support this, this call behaves as if Stop() had been called.

Implements StreamBase.

◆ AcquisitionInterface()

Cvb::Driver::AcquisitionInterface AcquisitionInterface ( ) const
inlineoverridevirtualnoexcept

Gets the interface of this implementation.

Returns
The current acquisition interface.
Exceptions
Doesnot throw any exception.

Implements StreamBase.

◆ AcquisitionState()

Cvb::AcquisitionState AcquisitionState ( ) const
inlinenoexcept

Gets the current acquisition state.

Returns
Current acquisition state.
Exceptions
Doesnot throw any exception.

◆ DeregisterFlowSetPool()

void DeregisterFlowSetPool ( )
inline

Removes an existing flow set pool from the acquisition engine.

Exceptions
Anyexception derived from std::exception including CvbException.

Removing a flow set pool can be useful in between subsequent registrations to reduce memory consumption. This method must only be called when the stream is in AcquisitionState::Stopped.

◆ DeviceAbort()

virtual void DeviceAbort ( )
inlinevirtual

Stops the stream in the device immediately.

Exceptions
Anyexception derived from std::exception including CvbException.

This stops the stream in the device as fast as possible interrupting the ongoing operation.

◆ DeviceStart() [1/2]

virtual void DeviceStart ( )
inlinevirtual

Starts the stream on the device.

Exceptions
Anyexception derived from std::exception including CvbException.

◆ DeviceStart() [2/2]

virtual void DeviceStart ( std::int64_t  bufferCountToAcquire)
inlinevirtual

Starts the stream on the device.

Parameters
[in]bufferCountToAcquireNumber of buffers to acquire.
Exceptions
Anyexception derived from std::exception including CvbException.

Same as DeviceStart but for a finite number of buffers.

◆ DeviceStop()

virtual void DeviceStop ( )
inlinevirtual

Stops the stream in the device.

Exceptions
Anyexception derived from std::exception including CvbException.

This stops the stream in the device engine gracefully letting the ongoing operation finish.

◆ EngineAbort()

virtual void EngineAbort ( )
inlinevirtual

Stops the acquisition engine immediately.

Exceptions
Anyexception derived from std::exception including CvbException.

This stops the acquisition engine as fast as possible interrupting the ongoing operation. This might result in partially acquired buffers. EngineAbort will also abort an ongoing EngineStop

Note
Even if abort fails the IsRunning will return false as it is safe to assume that the engine is not running anymore!

◆ EngineStart() [1/2]

virtual void EngineStart ( )
inlinevirtual

Starts the acquisition engine on the host.

Exceptions
Anyexception derived from std::exception including CvbException.

This starts continuous acquisition that needs to be stopped via EngineStop or EngineAbort.

◆ EngineStart() [2/2]

virtual void EngineStart ( std::int64_t  bufferCountToAcquire)
inlinevirtual

Starts the acquisition engine on the host.

Parameters
[in]bufferCountToAcquireNumber of buffers to acquire.
Exceptions
Anyexception derived from std::exception including CvbException.

Same as EngineStart but for a finite number of buffers. The engine automatically stops after acquiring the given number of buffers.

◆ EngineStop() [1/2]

void EngineStop ( const std::chrono::duration< Rep, Period > &  timeout)
inline

Stops the acquisition engine.

Parameters
[in]timeoutTimeout duration.
Exceptions
Anyexception derived from std::exception including CvbException.

This stops the acquisition engine gracefully letting the ongoing operation finish. If a graceful finish is not possible within the given timeout the acquisition is aborted, and an exception is thrown.

◆ EngineStop() [2/2]

virtual void EngineStop ( )
inlinevirtual

Stops the acquisition engine.

Exceptions
Anyexception derived from std::exception including CvbException.

This overload uses an infinite timeout

◆ FlowSetCount()

int FlowSetCount ( ) const
inlinenoexcept

Gets the number of registered flow sets.

Returns
The number of registered flow sets.
Exceptions
Doesnot throw any exception.

◆ FlowSetInfo()

std::vector<FlowInfo> FlowSetInfo ( ) const
inline

Gets the flow set info of this stream.

Returns
Flow set info of this stream.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ Handle()

void* Handle ( ) const
inlinenoexcept

Classic API stream handle.

Returns
Classic API handle.
Exceptions
Doesnot throw any exception.

It is normally not necessary to work with this handle.

◆ IsIndexed()

bool IsIndexed ( ) const
inlineoverridevirtualnoexcept

Gets whether this stream is an indexed stream.

Returns
True if indexed, false otherwise.
Exceptions
Doesnot throw any exception.
See also
IndexedStream

Implements StreamBase.

◆ MinRequiredFlowSetCount()

int MinRequiredFlowSetCount ( ) const
inline

Gets minimum number of flow sets required for the acquisition.

Returns
The minimum number of required flow sets.
Exceptions
Anyexception derived from std::exception including CvbException.
Note
The count is reported by the underlying technology and will at least be 3.

◆ NodeMap()

NodeMapPtr NodeMap ( const String name) const
inline

Gets the NodeMap with the given name.

Parameters
[in]nameThe NodeMap name.
Returns
A pointer to the NodeMap
Exceptions
Anyexception derived from std::exception including CvbException.
Example:
auto device = Cvb::Device::Open(Cvb::ExpandPath(CVB_LIT("%CVB%/drivers/GenICam.vin")));
auto stream = device->Stream<Cvb::ImageStream>();
auto streamNodeMap = stream->NodeMap(CVB_LIT("TLDatastream"));

◆ NodeMaps()

std::map< String, NodeMapPtr > NodeMaps ( ) const
inline

Gets the dictionary holding all available stream NodeMaps.

Returns
Dictionary containing all available node maps. Empty if no node map interface is available on this device.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ RegisterExternalFlowSetPool() [1/2]

void RegisterExternalFlowSetPool ( FlowSetPoolPtr  flowSetPoolPtr)
inline

Registers external memory.

Parameters
[in]flowSetPoolPtrMemory to register.

◆ RegisterExternalFlowSetPool() [2/2]

void RegisterExternalFlowSetPool ( FlowSetPoolPtr  flowSetPoolPtr,
std::function< void()>  releaseCallback 
)
inline

Registers external memory.

Parameters
[in]flowSetPoolPtrMemory to register.
[in]releaseCallbackCallback to be called on flowSetPool release

◆ RegisterManagedFlowSetPool()

void RegisterManagedFlowSetPool ( int  flowSetCount)
inline

Registers an internal flows set pool.

Parameters
[in]flowSetCountNumber of flow sets to allocate.
Exceptions
Anyexception derived from std::exception including CvbException.

Creates an internal flow set pool with the given size. Any previously registered flow set pool will be removed from the acquisition engine after the new flow set pool was created. In order to reduce memory consumption call DeregisterFlowSetPool between consecutive registrations.

◆ Start()

void Start ( )
inlineoverridevirtual

Starts the acquisition.

Exceptions
Anyexception derived from std::exception including CvbException.

The acquisition engine is started in on the host first, then the stream on the device is started.

Implements StreamBase.

◆ Stop()

void Stop ( )
inlineoverridevirtual

Stops the acquisition.

Exceptions
Anyexception derived from std::exception including CvbException.

This stops the acquisition gracefully letting the ongoing operation finish. The acquisition is stopped in the device first, then the engine on the host is stopped. The disadvantage may be that this call lasts until the timeout time of the last Wait() call.

Implements StreamBase.

◆ TryAbort()

bool TryAbort ( )
inlineoverridevirtualnoexcept

Stops the acquisition of images immediately.

Returns
True if successfully stopped, false on error.
Exceptions
Doesnot throw any exception.

Same as Abort(), but does not throw.

Implements StreamBase.

◆ TryDeviceAbort()

virtual bool TryDeviceAbort ( )
inlinevirtualnoexcept

Stops the stream in the device immediately.

Returns
True if successfully stopped, false on error.
Exceptions
Doesnot throw any exception.

Behaves like DeviceAbort, but does not throw.

◆ TryDeviceStop()

virtual bool TryDeviceStop ( )
inlinevirtualnoexcept

Stops the stream in the device.

Returns
True if successfully stopped, false on error.
Exceptions
Doesnot throw any exception.

Behaves like DeviceStop, but does not throw.

◆ TryEngineAbort()

virtual bool TryEngineAbort ( )
inlinevirtualnoexcept

Stops the acquisition engine immediately.

Returns
True if successfully stopped, false on error.
Exceptions
Doesnot throw any exception.

Behaves like EngineAbort, but does not throw.

◆ TryEngineStop() [1/3]

bool TryEngineStop ( const std::chrono::duration< Rep, Period > &  timeout)
inlinenoexcept

Stops the acquisition engine.

Parameters
[in]timeoutTimeout duration.
Returns
True if successfully stopped, false on error.
Exceptions
Doesnot throw any exception.

Behaves like EngineStop, but does not throw.

◆ TryEngineStop() [2/3]

virtual bool TryEngineStop ( )
inlinevirtualnoexcept

Stops the acquisition engine.

Returns
True if successfully stopped, false on error.
Exceptions
Doesnot throw any exception.

Behaves like EngineStop, but does not throw.

◆ TryEngineStop() [3/3]

virtual bool TryEngineStop ( const std::chrono::milliseconds timeout)
inlinevirtualnoexcept

Stops the acquisition engine.

Parameters
[in]timeoutTimeout in milliseconds.
Returns
True if successfully stopped, false on error.
Exceptions
Doesnot throw any exception.

Behaves like EngineStop, but does not throw.

◆ TryStop()

bool TryStop ( )
inlineoverridevirtualnoexcept

Stops the acquisition.

Returns
True if successfully stopped, false on error.
Exceptions
Doesnot throw any exception.

Same as Stop(), but does not throw.

Implements StreamBase.