All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
rcg::Stream Class Reference

The stream class encapsulates a Genicam stream. More...

#include <stream.h>

Inheritance diagram for rcg::Stream:

Public Member Functions

void attachBuffers (bool enable)
 Enabling or disabling attaching the grabbed buffer to the remote device nodemap. More...
 
void close ()
 Closes the stream. More...
 
int getAvailableBufferCount ()
 Returns the number ob buffers that are currently available for grabbing. More...
 
size_t getBufAlignment ()
 Returns some information about the stream. More...
 
size_t getBufAnnounceMin ()
 Returns some information about the stream. More...
 
bool getDefinesPayloadsize ()
 Returns some information about the stream. More...
 
void * getHandle () const
 Get internal stream handle. More...
 
const std::string & getID () const
 Get the internal ID of this stream. More...
 
bool getIsGrabbing ()
 Returns some information about the stream. More...
 
std::shared_ptr< GenApi::CNodeMapRefgetNodeMap ()
 Returns the node map of this object. More...
 
size_t getNumAnnounced ()
 Returns some information about the stream. More...
 
size_t getNumAwaitDelivery ()
 Returns some information about the stream. More...
 
size_t getNumChunksMax ()
 Returns some information about the stream. More...
 
uint64_t getNumDelivered ()
 Returns some information about the stream. More...
 
size_t getNumQueued ()
 Returns some information about the stream. More...
 
uint64_t getNumStarted ()
 Returns some information about the stream. More...
 
uint64_t getNumUnderrun ()
 Returns some information about the stream. More...
 
std::shared_ptr< DevicegetParent () const
 Returns the pointer to the parent device object. More...
 
size_t getPayloadSize ()
 Returns some information about the stream. More...
 
std::string getTLType ()
 Returns some information about the stream. More...
 
const Buffergrab (int64_t timeout=-1)
 Wait for the next image or data and return it in a buffer object. More...
 
void open ()
 Opens the stream for working with it. More...
 
void startStreaming (int nacquire, int min_buffers)
 Allocates the given minimum number of buffers, registers internal events and starts streaming of nacquire buffers. More...
 
void startStreaming (int nacquire=-1)
 Allocates four buffers, registers internal events and starts streaming of nacquire buffers. More...
 
void stopStreaming ()
 Stops streaming. More...
 
 Stream (const std::shared_ptr< Device > &parent, const std::shared_ptr< const GenTLWrapper > &gentl, const char *id)
 Constructs a stream class. More...
 
 ~Stream ()
 

Private Member Functions

Streamoperator= (const Stream &)
 
 Stream (class Stream &)
 

Private Attributes

size_t bn
 
Buffer buffer
 
std::shared_ptr< CPortcport
 
void * event
 
std::shared_ptr< const GenTLWrappergentl
 
std::string id
 
std::recursive_mutex mtx
 
int n_open
 
std::shared_ptr< GenApi::CNodeMapRefnodemap
 
std::shared_ptr< Deviceparent
 
void * stream
 

Detailed Description

The stream class encapsulates a Genicam stream.

NOTE: A GenTLException is thrown in case of a severe error.

Definition at line 55 of file stream.h.

Constructor & Destructor Documentation

◆ Stream() [1/2]

rcg::Stream::Stream ( const std::shared_ptr< Device > &  parent,
const std::shared_ptr< const GenTLWrapper > &  gentl,
const char *  id 
)

Constructs a stream class.

Streams must only be created by the device class.

Definition at line 54 of file stream.cc.

◆ ~Stream()

rcg::Stream::~Stream ( )

Definition at line 68 of file stream.cc.

◆ Stream() [2/2]

rcg::Stream::Stream ( class Stream )
private

Member Function Documentation

◆ attachBuffers()

void rcg::Stream::attachBuffers ( bool  enable)

Enabling or disabling attaching the grabbed buffer to the remote device nodemap.

This only has an effect if chunks are enabled (i.e. ChunkModeActive=true).

Parameters
enableEnables or disables attaching grabbed buffers to the nodemap.

Definition at line 151 of file stream.cc.

◆ close()

void rcg::Stream::close ( )

Closes the stream.

Each call of open() must be followed by a call to close() at some point in time.

Definition at line 121 of file stream.cc.

◆ getAvailableBufferCount()

int rcg::Stream::getAvailableBufferCount ( )

Returns the number ob buffers that are currently available for grabbing.

Returns
Number of buffers, available for immediate grabbing.

Definition at line 337 of file stream.cc.

◆ getBufAlignment()

size_t rcg::Stream::getBufAlignment ( )

Returns some information about the stream.

NOTE: open() must have called before calling this method.

Returns
Buffer alignment in bytes.

Definition at line 539 of file stream.cc.

◆ getBufAnnounceMin()

size_t rcg::Stream::getBufAnnounceMin ( )

Returns some information about the stream.

NOTE: open() must have called before calling this method.

Returns
Min number of buffers to announce before acq can start, if known.

Definition at line 533 of file stream.cc.

◆ getDefinesPayloadsize()

bool rcg::Stream::getDefinesPayloadsize ( )

Returns some information about the stream.

NOTE: open() must have called before calling this method.

Returns
Flag that indicated that this data stream defines a payload size independent from the remote device.

Definition at line 497 of file stream.cc.

◆ getHandle()

void * rcg::Stream::getHandle ( ) const

Get internal stream handle.

Returns
Internal handle.

Definition at line 557 of file stream.cc.

◆ getID()

const std::string & rcg::Stream::getID ( ) const

Get the internal ID of this stream.

Returns
ID.

Definition at line 93 of file stream.cc.

◆ getIsGrabbing()

bool rcg::Stream::getIsGrabbing ( )

Returns some information about the stream.

NOTE: open() must have called before calling this method.

Returns
Flag indicating whether the acquisition engine is started or not.

Definition at line 491 of file stream.cc.

◆ getNodeMap()

std::shared_ptr< GenApi::CNodeMapRef > rcg::Stream::getNodeMap ( )

Returns the node map of this object.

NOTE: open() must be called before calling this method. The returned pointer remains valid until close() of this object is called.

Returns
Node map of this object.

Definition at line 545 of file stream.cc.

◆ getNumAnnounced()

size_t rcg::Stream::getNumAnnounced ( )

Returns some information about the stream.

NOTE: open() must have called before calling this method.

Returns
Number of announced buffers.

Definition at line 461 of file stream.cc.

◆ getNumAwaitDelivery()

size_t rcg::Stream::getNumAwaitDelivery ( )

Returns some information about the stream.

NOTE: open() must have called before calling this method.

Returns
Number of buffers in the output queue.

Definition at line 473 of file stream.cc.

◆ getNumChunksMax()

size_t rcg::Stream::getNumChunksMax ( )

Returns some information about the stream.

NOTE: open() must have called before calling this method.

Returns
Max number of chunks in a buffer, if known.

Definition at line 527 of file stream.cc.

◆ getNumDelivered()

uint64_t rcg::Stream::getNumDelivered ( )

Returns some information about the stream.

NOTE: open() must have called before calling this method.

Returns
Number of delivered buffers since last acquisition start.

Definition at line 449 of file stream.cc.

◆ getNumQueued()

size_t rcg::Stream::getNumQueued ( )

Returns some information about the stream.

NOTE: open() must have called before calling this method.

Returns
Number of buffers in the input pool.

Definition at line 467 of file stream.cc.

◆ getNumStarted()

uint64_t rcg::Stream::getNumStarted ( )

Returns some information about the stream.

NOTE: open() must have called before calling this method.

Returns
Number of buffers started in the acquisition engine.

Definition at line 479 of file stream.cc.

◆ getNumUnderrun()

uint64_t rcg::Stream::getNumUnderrun ( )

Returns some information about the stream.

NOTE: open() must have called before calling this method.

Returns
Number of lost buffers due to queue underrun.

Definition at line 455 of file stream.cc.

◆ getParent()

std::shared_ptr< Device > rcg::Stream::getParent ( ) const

Returns the pointer to the parent device object.

Returns
Pointer to parent device object.

Definition at line 88 of file stream.cc.

◆ getPayloadSize()

size_t rcg::Stream::getPayloadSize ( )

Returns some information about the stream.

NOTE: open() must have called before calling this method.

Returns
Size of the expected data in bytes.

Definition at line 485 of file stream.cc.

◆ getTLType()

std::string rcg::Stream::getTLType ( )

Returns some information about the stream.

NOTE: open() must have called before calling this method.

Returns
Transport layer technology that is supported.

Definition at line 503 of file stream.cc.

◆ grab()

const Buffer * rcg::Stream::grab ( int64_t  timeout = -1)

Wait for the next image or data and return it in a buffer object.

The buffer is valid until the next call to grab.

Parameters
timeoutTimeout in ms. A value < 0 sets waiting time to infinite.
Returns
Pointer to received buffer or 0 in case of an error or interrupt.

Definition at line 355 of file stream.cc.

◆ open()

void rcg::Stream::open ( )

Opens the stream for working with it.

The stream may be opened multiple times. However, for each open(), the close() method must be called as well.

Definition at line 98 of file stream.cc.

◆ operator=()

Stream& rcg::Stream::operator= ( const Stream )
private

◆ startStreaming() [1/2]

void rcg::Stream::startStreaming ( int  nacquire,
int  min_buffers 
)

Allocates the given minimum number of buffers, registers internal events and starts streaming of nacquire buffers.

Parameters
naNumber of buffers to acquire. Set <= 0 for infinity.
min_buffersMiminum number of buffers to allocate.

Definition at line 172 of file stream.cc.

◆ startStreaming() [2/2]

void rcg::Stream::startStreaming ( int  nacquire = -1)

Allocates four buffers, registers internal events and starts streaming of nacquire buffers.

Parameters
naNumber of buffers to acquire. Set <= 0 for infinity.

Definition at line 167 of file stream.cc.

◆ stopStreaming()

void rcg::Stream::stopStreaming ( )

Stops streaming.

Definition at line 294 of file stream.cc.

Member Data Documentation

◆ bn

size_t rcg::Stream::bn
private

Definition at line 320 of file stream.h.

◆ buffer

Buffer rcg::Stream::buffer
private

Definition at line 309 of file stream.h.

◆ cport

std::shared_ptr<CPort> rcg::Stream::cport
private

Definition at line 322 of file stream.h.

◆ event

void* rcg::Stream::event
private

Definition at line 319 of file stream.h.

◆ gentl

std::shared_ptr<const GenTLWrapper> rcg::Stream::gentl
private

Definition at line 312 of file stream.h.

◆ id

std::string rcg::Stream::id
private

Definition at line 313 of file stream.h.

◆ mtx

std::recursive_mutex rcg::Stream::mtx
private

Definition at line 315 of file stream.h.

◆ n_open

int rcg::Stream::n_open
private

Definition at line 317 of file stream.h.

◆ nodemap

std::shared_ptr<GenApi::CNodeMapRef> rcg::Stream::nodemap
private

Definition at line 323 of file stream.h.

◆ parent

std::shared_ptr<Device> rcg::Stream::parent
private

Definition at line 311 of file stream.h.

◆ stream

void* rcg::Stream::stream
private

Definition at line 318 of file stream.h.


The documentation for this class was generated from the following files:


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Wed Dec 4 2024 03:10:13