openDAQ
Open data acquisition platform
ConnectionPtr Class Reference

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

Inherits ObjectPtr< IConnection >.

Detailed Description

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

void enqueue (const daq::PacketPtr &packet) const
 Places a packet at the back of the queue. More...
 
void enqueueOnThisThread (const daq::PacketPtr &packet) const
 Places a packet at the back of the queue. More...
 
daq::PacketPtr dequeue () const
 Removes the packet at the front of the queue and returns it. More...
 
daq::PacketPtr peek () const
 Returns the packet at the front of the queue without removing it. More...
 
daq::SizeT getPacketCount () const
 Gets the number of queued packets. More...
 
daq::ObjectPtr< ISignalgetSignal () const
 Gets the Signal that is sending packets through the Connection. More...
 
daq::ObjectPtr< IInputPortgetInputPort () const
 Gets the Input port to which packets are being sent. More...
 
daq::SizeT getAvailableSamples () const
 Gets the number of samples available in the queued packets. The returned value ignores any Sample-Descriptor changes. More...
 
daq::SizeT getSamplesUntilNextDescriptor () const
 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...
 
daq::Bool isRemote () const
 Returns true if the type of connection is remote. More...
 
void enqueue (daq::PacketPtr &&packet) const
 Places a packet at the back of the queue. The reference of the packet is stolen. More...
 
void enqueueMultiple (const daq::ListPtr< daq::IPacket > &packets) const
 Places multiple packets at the back of the queue. More...
 
void enqueueMultiple (daq::ListPtr< daq::IPacket > &&packets) const
 Places multiple packets at the back of the queue. The references of the packets are stolen. More...
 
daq::ListPtr< daq::IPacket > dequeueAll () const
 Removes all packets from the queue. More...
 
daq::SizeT getSamplesUntilNextEventPacket () const
 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...
 
daq::SizeT getSamplesUntilNextGapPacket () const
 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...
 
daq::Bool hasEventPacket () const
 Queries if the connection has an event packet. More...
 
daq::Bool hasGapPacket () const
 Queries if the connection has a gap packet. More...