CVB++ 14.0
Stream Class Referenceabstract

Represents one acquisition stream of a device. More...

#include <cvb/driver/stream.hpp>

Inherits StreamBase.

Inherited by IndexedStream.

Public Member Functions

Cvb::Driver::AcquisitionInterface AcquisitionInterface () const noexcept override
 Gets the interface of this implementation. More...
 
void SetAcquisitionInterface (Cvb::Driver::AcquisitionInterface acquisitionInterface)
 Sets 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 IsRunning () const noexcept
 Gets whether the acquisition is currently active. More...
 
virtual bool IsIndexed () const noexcept override
 Gets whether this stream is an indexed stream. More...
 
double Statistics (StreamInfo query) const
 Gets statistics value if supported. More...
 
template<class T >
Statistics (StreamInfo query) const
 Gets statistics value if supported. More...
 
virtual RingBufferPtr RingBuffer () const noexcept
 Gets the ring buffer interface object if present. More...
 
template<class T , class Rep , class Period >
std::shared_ptr< T > WaitFor (const std::chrono::duration< Rep, Period > &timeSpan, WaitStatus &waitStatus)
 Waits for the given time span for the next acquired image. More...
 
template<class Rep , class Period >
StreamImagePtr WaitFor (const std::chrono::duration< Rep, Period > &timeSpan, WaitStatus &waitStatus)
 Waits for the given time span for the next acquired image. More...
 
template<class T , class Rep , class Period >
WaitResult< T > WaitFor (const std::chrono::duration< Rep, Period > &timeSpan)
 Waits for the given time span for the next acquired image. More...
 
template<class Rep , class Period >
WaitResult< StreamImageWaitFor (const std::chrono::duration< Rep, Period > &timeSpan)
 Waits for the given time span for the next acquired image. More...
 
template<class T >
std::shared_ptr< T > Wait (WaitStatus &waitStatus)
 Waits forever for the next acquired image and returns it. More...
 
StreamImagePtr Wait (WaitStatus &waitStatus)
 Waits for ever for the next acquired image and returns it. More...
 
template<class T >
WaitResult< T > Wait ()
 Waits for ever for the next acquired image and returns it. More...
 
WaitResult< StreamImageWait ()
 Waits for ever for the next acquired image and returns it. More...
 
template<class T , class Rep , class Period >
std::shared_ptr< T > GetTimedSnapshot (const std::chrono::duration< Rep, Period > &timeSpan, WaitStatus &waitStatus)
 Acquires a single image for a given time span and returns it. More...
 
template<class Rep , class Period >
StreamImagePtr GetTimedSnapshot (const std::chrono::duration< Rep, Period > &timeSpan, WaitStatus &waitStatus)
 Acquires a single image for a given time span and returns it. More...
 
template<class T , class Rep , class Period >
WaitResult< T > GetTimedSnapshot (const std::chrono::duration< Rep, Period > &timeSpan)
 Acquires a single image for a given time span and returns it. More...
 
template<class Rep , class Period >
WaitResult< StreamImageGetTimedSnapshot (const std::chrono::duration< Rep, Period > &timeSpan)
 Acquires a single image for a given time span and returns it. More...
 
StreamImagePtr GetSnapshot (WaitStatus &waitStatus)
 Acquires a single image and returns it. More...
 
WaitResult< StreamImageGetSnapshot ()
 Acquires a single image and returns it. More...
 
- Public Member Functions inherited from StreamBase
DevicePtr Parent () const noexcept
 Gets the parent device of this stream. More...
 
virtual Cvb::Driver::AcquisitionInterface AcquisitionInterface () const noexcept=0
 Gets the interface of this implementation. More...
 
virtual void Start ()=0
 Starts the acquisition. More...
 
virtual void Stop ()=0
 Stops the acquisition. More...
 
virtual bool TryStop () noexcept=0
 Stops the acquisition. More...
 
virtual void Abort ()=0
 Stops the acquisition of images immediately. More...
 
virtual bool TryAbort () noexcept=0
 Stops the acquisition of images immediately. More...
 
virtual bool IsIndexed () const noexcept=0
 Gets whether this stream is an indexed stream. More...
 

Detailed Description

Represents one acquisition stream of a device.

Deprecated:
This class is deprecated for all technologies providing a GenTL. Use ImageStream, PointCloudStream or CompositeStream instead.

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.

◆ GetSnapshot() [1/2]

WaitResult< StreamImage > GetSnapshot ( )
inline

Acquires a single image and returns it.

Returns
Wait result; a combination of an image and status.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ GetSnapshot() [2/2]

StreamImagePtr GetSnapshot ( WaitStatus waitStatus)
inline

Acquires a single image and returns it.

Parameters
[out]waitStatusThe status of the wait operation.
Returns
Pointer to valid stream image, or null pointer if status is not Cvb::WaitStatus::Ok.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ GetTimedSnapshot() [1/4]

WaitResult< T > GetTimedSnapshot ( const std::chrono::duration< Rep, Period > &  timeSpan)
inline

Acquires a single image for a given time span and returns it.

Parameters
[in]timeSpanTime to wait for an image.
Returns
Wait result; a combination of an image (cast to the given type) and status.
Exceptions
Anyexception derived from std::exception including CvbException

◆ GetTimedSnapshot() [2/4]

WaitResult< StreamImage > GetTimedSnapshot ( const std::chrono::duration< Rep, Period > &  timeSpan)
inline

Acquires a single image for a given time span and returns it.

Parameters
[in]timeSpanTime to wait for an image.
Returns
Wait result; a combination of an image and status.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ GetTimedSnapshot() [3/4]

std::shared_ptr< T > GetTimedSnapshot ( const std::chrono::duration< Rep, Period > &  timeSpan,
WaitStatus waitStatus 
)
inline

Acquires a single image for a given time span and returns it.

Parameters
[in]timeSpanTime to wait for an image.
[out]waitStatusThe status of the wait operation.
Returns
Pointer to valid image (cast to the given type), or null pointer if status is not Cvb::WaitStatus::Ok.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ GetTimedSnapshot() [4/4]

StreamImagePtr GetTimedSnapshot ( const std::chrono::duration< Rep, Period > &  timeSpan,
WaitStatus waitStatus 
)
inline

Acquires a single image for a given time span and returns it.

Parameters
[in]timeSpanTime to wait for an image.
[out]waitStatusThe status of the wait operation.
Returns
Pointer to valid stream image, or null pointer if status is not Cvb::WaitStatus::Ok.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ IsIndexed()

virtual 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.

Reimplemented in IndexedStream.

◆ IsRunning()

bool IsRunning ( ) const
inlinenoexcept

Gets whether the acquisition is currently active.

Returns
True if the acquisition is active, false otherwise.
Exceptions
Doesnot throw any exception.

This state only refers to the acquisition engine on the host. The state of the device might have been changed e.g via the NodeMap so there is no guarantee that it is in the same state.

◆ RingBuffer()

virtual RingBufferPtr RingBuffer ( ) const
inlinevirtualnoexcept

Gets the ring buffer interface object if present.

Returns
A pointer to the ring buffer object, or a null pointer if not present.
Exceptions
Doesnot throw any exception.

◆ SetAcquisitionInterface()

void SetAcquisitionInterface ( Cvb::Driver::AcquisitionInterface  acquisitionInterface)
inline

Sets the interface of this implementation.

Parameters
[in]acquisitionInterfaceThe new acquisition interface.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ 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.

◆ Statistics() [1/2]

double Statistics ( StreamInfo  query) const
inline

Gets statistics value if supported.

Parameters
[in]queryStatistical information request.
Returns
Driver dependent value.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ Statistics() [2/2]

T Statistics ( StreamInfo  query) const
inline

Gets statistics value if supported.

Parameters
[in]queryStatistical information request.
Returns
T Driver dependent value (cast from double to T).
Exceptions
Anyexception derived from std::exception including CvbException.

◆ 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.

◆ 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.

◆ Wait() [1/4]

WaitResult< T > Wait ( )
inline

Waits for ever for the next acquired image and returns it.

Returns
Wait result; a combination of an image (cast to the given type) and status.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ Wait() [2/4]

WaitResult< StreamImage > Wait ( )
inline

Waits for ever for the next acquired image and returns it.

Returns
Wait result; a combination of an image and status.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ Wait() [3/4]

std::shared_ptr< T > Wait ( WaitStatus waitStatus)
inline

Waits forever for the next acquired image and returns it.

Parameters
[out]waitStatusThe status of the wait operation.
Returns
Pointer to valid image (cast to the given type), or null pointer if status is not Cvb::WaitStatus::Ok.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ Wait() [4/4]

StreamImagePtr Wait ( WaitStatus waitStatus)
inline

Waits for ever for the next acquired image and returns it.

Parameters
[out]waitStatusThe status of the wait operation.
Returns
Pointer to valid stream image, or null pointer if status is not Cvb::WaitStatus::Ok.
Exceptions
Doesnot throw any exception.

◆ WaitFor() [1/4]

WaitResult< T > WaitFor ( const std::chrono::duration< Rep, Period > &  timeSpan)
inline

Waits for the given time span for the next acquired image.

Parameters
[in]timeSpanTime to wait for an image.
Returns
Wait result; a combination of an image (cast to the given type) and status.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ WaitFor() [2/4]

WaitResult< StreamImage > WaitFor ( const std::chrono::duration< Rep, Period > &  timeSpan)
inline

Waits for the given time span for the next acquired image.

Parameters
[in]timeSpanTime to wait for an image.
Returns
Wait result; a combination of an image and status.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ WaitFor() [3/4]

std::shared_ptr< T > WaitFor ( const std::chrono::duration< Rep, Period > &  timeSpan,
WaitStatus waitStatus 
)
inline

Waits for the given time span for the next acquired image.

Parameters
[in]timeSpanTime to wait for an image.
[out]waitStatusThe status of the wait operation.
Returns
Pointer to valid image (cast to the given type), or null pointer if status is not Cvb::WaitStatus::Ok.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ WaitFor() [4/4]

StreamImagePtr WaitFor ( const std::chrono::duration< Rep, Period > &  timeSpan,
WaitStatus waitStatus 
)
inline

Waits for the given time span for the next acquired image.

Parameters
[in]timeSpanTime to wait for an image.
[out]waitStatusThe status of the wait operation.
Returns
Pointer to valid stream image, or null pointer if status is not Cvb::WaitStatus::Ok.
Exceptions
Anyexception derived from std::exception including CvbException.