Represents a connection between an Input port and Signal. Acts as a queue for packets sent by the signal, which can be read by the input port and the input port's owner. More...
Represents a connection between an Input port and Signal. Acts as a queue for packets sent by the signal, which can be read by the input port and the input port's owner.
The Connection provides standard queue methods, allowing for packets to be put at the back of the queue, and popped from the front. Additionally, the front packet can be inspected via peek
, and the number of queued packets can be obtained through getPacketCount
.
The Connection has a reference to the connected Signal and Input port.
Public Member Functions | |
virtual ErrCode INTERFACE_FUNC | enqueue (IPacket *packet)=0 |
Places a packet at the back of the queue. More... | |
virtual ErrCode INTERFACE_FUNC | enqueueOnThisThread (IPacket *packet)=0 |
Places a packet at the back of the queue. More... | |
virtual ErrCode INTERFACE_FUNC | dequeue (IPacket **packet)=0 |
Removes the packet at the front of the queue and returns it. More... | |
virtual ErrCode INTERFACE_FUNC | peek (IPacket **packet)=0 |
Returns the packet at the front of the queue without removing it. More... | |
virtual ErrCode INTERFACE_FUNC | getPacketCount (SizeT *packetCount)=0 |
Gets the number of queued packets. More... | |
virtual ErrCode INTERFACE_FUNC | getSignal (ISignal **signal)=0 |
Gets the Signal that is sending packets through the Connection. More... | |
virtual ErrCode INTERFACE_FUNC | getInputPort (IInputPort **inputPort)=0 |
Gets the Input port to which packets are being sent. More... | |
virtual ErrCode INTERFACE_FUNC | getAvailableSamples (SizeT *samples)=0 |
Gets the number of samples available in the queued packets. The returned value ignores any Sample-Descriptor changes. More... | |
virtual ErrCode INTERFACE_FUNC | getSamplesUntilNextDescriptor (SizeT *samples)=0 |
Gets the number of same-type samples available in the queued packets. The returned value is up-to the next Sample-Descriptor-Changed packet if any. More... | |
virtual ErrCode INTERFACE_FUNC | isRemote (Bool *remote)=0 |
Returns true if the type of connection is remote. More... | |
virtual ErrCode INTERFACE_FUNC | enqueueAndStealRef (IPacket *packet)=0 |
Places a packet at the back of the queue. The reference of the packet is stolen. More... | |
virtual ErrCode INTERFACE_FUNC | enqueueMultiple (IList *packets)=0 |
Places multiple packets at the back of the queue. More... | |
virtual ErrCode INTERFACE_FUNC | enqueueMultipleAndStealRef (IList *packets)=0 |
Places multiple packets at the back of the queue. The references of the packets are stolen. More... | |
virtual ErrCode INTERFACE_FUNC | dequeueAll (IList **packets)=0 |
Removes all packets from the queue. More... | |
virtual ErrCode INTERFACE_FUNC | getSamplesUntilNextEventPacket (SizeT *samples)=0 |
Gets the number of samples available in the queued packets until the next event packet. The returned value is up-to the next Event packet if any. More... | |
virtual ErrCode INTERFACE_FUNC | getSamplesUntilNextGapPacket (SizeT *samples)=0 |
Gets the number of samples available in the queued packets until the next gap packet. The returned value is up-to the next Gap packet if any. More... | |
virtual ErrCode INTERFACE_FUNC | hasEventPacket (Bool *hasEventPacket)=0 |
Queries if the connection has an event packet. More... | |
virtual ErrCode INTERFACE_FUNC | hasGapPacket (Bool *hasGapPacket)=0 |
Queries if the connection has a gap packet. More... | |
![]() | |
virtual ErrCode INTERFACE_FUNC | borrowInterface (const IntfID &intfID, void **obj) const =0 |
Returns another interface which is supported by the object without incrementing the reference count. More... | |
virtual ErrCode INTERFACE_FUNC | dispose ()=0 |
Disposes all references held by the object. More... | |
virtual ErrCode INTERFACE_FUNC | getHashCode (SizeT *hashCode)=0 |
Returns hash code of the object. More... | |
virtual ErrCode INTERFACE_FUNC | equals (IBaseObject *other, Bool *equal) const =0 |
Compares object to another object for equality. More... | |
virtual ErrCode INTERFACE_FUNC | toString (CharPtr *str)=0 |
Returns a string representation of the object. More... | |
![]() | |
virtual ErrCode INTERFACE_FUNC | queryInterface (const IntfID &intfID, void **obj)=0 |
Returns another interface which is supported by the object and increments the reference count. More... | |
virtual int INTERFACE_FUNC | addRef ()=0 |
Increments the reference count for an interface on an object. More... | |
virtual int INTERFACE_FUNC | releaseRef ()=0 |
Decrements the reference count for an interface on an object. More... | |
Removes the packet at the front of the queue and returns it.
[out] | packet | The removed packet or nullptr if the connection has no packets. |
OPENDAQ_NO_MORE_ITEMS | When the connection does not hold any packets. |
Removes all packets from the queue.
[out] | packets | The removed packets. |
Removing all packets can be more efficient than dequeuing packet by packet in heavily loaded systems.
Places a packet at the back of the queue.
packet | The packet to be enqueued. |
Places a packet at the back of the queue. The reference of the packet is stolen.
packet | The packet to be enqueued. |
After calling the method, the packet should not be touched again. The ownership of the packet is taken by underlying connections and it could be destroyed before the function returns.
Places multiple packets at the back of the queue.
packets | The packets to be enqueued. |
Places multiple packets at the back of the queue. The references of the packets are stolen.
packets | The packets to be enqueued. |
After calling the method, the packets should not be touched again. The ownership of the packets is taken by underlying connections and it could be destroyed before the function returns.
Places a packet at the back of the queue.
packet | The packet to be enqueued. |
The connection notifies the listener on the same thread that this method was called.
|
pure virtual |
Gets the number of samples available in the queued packets. The returned value ignores any Sample-Descriptor changes.
[out] | samples | The total amount of samples currently available in the stored packets. |
|
pure virtual |
Gets the Input port to which packets are being sent.
[out] | inputPort | The input port. |
|
pure virtual |
Gets the number of queued packets.
[out] | packetCount | The number of queued packets. |
|
pure virtual |
Gets the number of same-type samples available in the queued packets. The returned value is up-to the next Sample-Descriptor-Changed packet if any.
[out] | samples | The total amount of same-type samples currently available in the stored packets. |
|
pure virtual |
Gets the number of samples available in the queued packets until the next event packet. The returned value is up-to the next Event packet if any.
[out] | samples | The total amount of samples currently available in the stored packets until the next event packet. |
|
pure virtual |
Gets the number of samples available in the queued packets until the next gap packet. The returned value is up-to the next Gap packet if any.
[out] | samples | The total amount of samples currently available in the stored packets until the next gap packet. |
Gets the Signal that is sending packets through the Connection.
[out] | signal | The Signal. |
|
pure virtual |
Queries if the connection has an event packet.
[out] | hasEventPacket | True if the connection has an event packet. |
|
pure virtual |
Queries if the connection has a gap packet.
[out] | hasGapPacket | True if the connection has a gap packet. |
|
pure virtual |
Returns true if the type of connection is remote.
[out] | remote | True if connection is remote. |
Remote connections do not pass any packets. They represent the connection between input ports and signals on remote devices.
Returns the packet at the front of the queue without removing it.
[out] | packet | The packet at the front of the queue or nullptr if the connection has no packets. |
OPENDAQ_NO_MORE_ITEMS | When the connection does not hold any packets. |