55 const std::shared_ptr<const GenTLWrapper> &_gentl,
const char *_id) :
95 std::lock_guard<std::recursive_mutex> lock(
mtx);
99 if (
parent->getHandle() != 0)
109 throw GenTLException(
"Stream::open(): Device must be opened before open before opening a stream");
118 std::lock_guard<std::recursive_mutex> lock(
mtx);
142 if (
parent->getHandle() != 0)
144 std::shared_ptr<GenApi::CNodeMapRef> rnodemap=
parent->getRemoteNodeMap();
156 std::lock_guard<std::recursive_mutex> lock(
mtx);
162 throw GenTLException(
"Stream::startStreaming(): Stream is not open");
174 std::shared_ptr<GenApi::CNodeMapRef> nmap=
parent->getRemoteNodeMap();
191 std::shared_ptr<GenApi::CNodeMapRef> nmap=
parent->getRemoteNodeMap();
196 size=
static_cast<size_t>(p->GetValue());
205 for (
size_t i=0; i<
bn; i++)
236 n=
static_cast<uint64_t
>(na);
266 std::shared_ptr<GenApi::CNodeMapRef> nmap=
parent->getRemoteNodeMap();
280 std::lock_guard<std::recursive_mutex> lock(
mtx);
297 for (
size_t i=0; i<
bn; i++)
311 std::shared_ptr<GenApi::CNodeMapRef> nmap=
parent->getRemoteNodeMap();
323 std::lock_guard<std::recursive_mutex> lock(
mtx);
328 timeout=
static_cast<uint64_t
>(_timeout);
355 memset(&data, 0, size);
381 template<
class T>
inline T getStreamValue(
const std::shared_ptr<const GenTLWrapper> &
gentl,
387 size_t size=
sizeof(T);
391 gentl->DSGetInfo(stream, cmd, &type, &ret, &size);
397 inline bool getStreamBool(
const std::shared_ptr<const GenTLWrapper> &gentl,
403 size_t size=
sizeof(ret);
407 gentl->DSGetInfo(stream, cmd, &type, &ret, &size);
417 std::lock_guard<std::recursive_mutex> lock(
mtx);
423 std::lock_guard<std::recursive_mutex> lock(
mtx);
429 std::lock_guard<std::recursive_mutex> lock(
mtx);
435 std::lock_guard<std::recursive_mutex> lock(
mtx);
441 std::lock_guard<std::recursive_mutex> lock(
mtx);
447 std::lock_guard<std::recursive_mutex> lock(
mtx);
453 std::lock_guard<std::recursive_mutex> lock(
mtx);
459 std::lock_guard<std::recursive_mutex> lock(
mtx);
465 std::lock_guard<std::recursive_mutex> lock(
mtx);
471 std::lock_guard<std::recursive_mutex> lock(
mtx);
476 size_t size=
sizeof(tmp);
495 std::lock_guard<std::recursive_mutex> lock(
mtx);
501 std::lock_guard<std::recursive_mutex> lock(
mtx);
507 std::lock_guard<std::recursive_mutex> lock(
mtx);
513 std::lock_guard<std::recursive_mutex> lock(
mtx);
uint64_t getNumDelivered()
Returns some information about the stream.
const Buffer * grab(int64_t timeout=-1)
Wait for the next image or data and return it in a buffer object.
std::shared_ptr< GenApi::CNodeMapRef > nodemap
GENICAM_INTERFACE IInteger
Interface for integer properties.
size_t getNumAwaitDelivery()
Returns some information about the stream.
This is the port definition that connects GenAPI to GenTL.
std::string getTLType()
Returns some information about the stream.
void * getHandle() const
Get internal stream handle.
struct S_EVENT_NEW_BUFFER EVENT_NEW_BUFFER_DATA
size_t getNumAnnounced()
Returns some information about the stream.
std::shared_ptr< Device > getParent() const
Returns the pointer to the parent device object.
void stopStreaming()
Stops streaming.
const std::string & getID() const
Get the internal ID of this stream.
void attachBuffers(bool enable)
Enabling or disabling attaching the grabbed buffer to the remote device nodemap.
bool IsReadable(EAccessMode AccessMode)
Tests if readable.
uint64_t getNumStarted()
Returns some information about the stream.
std::shared_ptr< const GenTLWrapper > gentl
void startStreaming(int na=-1)
Allocates buffers and registers internal events if necessary and starts streaming.
size_t getNumChunksMax()
Returns some information about the stream.
size_t getNumQueued()
Returns some information about the stream.
bool getDefinesPayloadsize()
Returns some information about the stream.
The buffer class encapsulates a Genicam buffer that is provided by a stream.
size_t getPayloadSize()
Returns some information about the stream.
Encapsulates a GenApi pointer dealing with the dynamic_cast automatically.
Stream(const std::shared_ptr< Device > &parent, const std::shared_ptr< const GenTLWrapper > &gentl, const char *id)
Constructs a stream class.
std::shared_ptr< CPort > cport
bool getIsGrabbing()
Returns some information about the stream.
void * getHandle() const
Get internal stream handle.
void setNodemap(const std::shared_ptr< GenApi::CNodeMapRef > nodemap, const std::string &tltype)
Set the device nodemap.
std::shared_ptr< Device > parent
std::shared_ptr< GenApi::CNodeMapRef > allocNodeMap(std::shared_ptr< const GenTLWrapper > gentl, void *port, CPort *cport, const char *xml)
Convenience function that returns a GenICam node map from the given port.
std::shared_ptr< GenApi::CNodeMapRef > getNodeMap()
Returns the node map of this object.
bool IsWritable(EAccessMode AccessMode)
Tests if writable.
void open()
Opens the stream for working with it.
void setHandle(void *handle)
Set the buffer handle that this object should manage.
void close()
Closes the stream.
uint64_t getNumUnderrun()
Returns some information about the stream.
size_t getBufAnnounceMin()
Returns some information about the stream.
size_t getBufAlignment()
Returns some information about the stream.