#include <icy/packetqueue.h>Inherits:
AsyncQueue< IPacket >,PacketProcessor
Thread-based asynchronous packet dispatch queue.
| Return | Name | Description |
|---|---|---|
PacketSignal | emitter |
PacketSignal emitter| Return | Name | Description |
|---|---|---|
AsyncPacketQueue inline | #### Parameters | |
void | close virtual inline | Flushes remaining packets, cancels the queue, and joins the dispatch thread. |
void | process virtual inline | Clones the incoming packet and pushes it onto the async queue. This queue is therefore an explicit PacketStream ownership boundary. Drops the packet with a warning if the queue has been cancelled. |
bool | accepts virtual inline | Returns true if the packet can be cast to type T. |
PacketRetention | retention virtual const inline | Returns how this adapter treats incoming packet lifetime. Most adapters are synchronous and therefore only borrow the packet for the current call chain. Queue-style adapters override this to advertise that they clone before deferred use. Callers may treat the first adapter reporting Cloned or Retained as the explicit ownership boundary in the stream graph. |
inline
inline AsyncPacketQueue(int maxSize)maxSize Maximum number of queued packets before oldest are dropped.virtual inline
virtual inline void close()Flushes remaining packets, cancels the queue, and joins the dispatch thread.
virtual inline
virtual inline void process(IPacket & packet)Clones the incoming packet and pushes it onto the async queue. This queue is therefore an explicit PacketStream ownership boundary. Drops the packet with a warning if the queue has been cancelled.
packet Incoming packet to enqueue.virtual inline
virtual inline bool accepts(IPacket * packet)Returns true if the packet can be cast to type T.
packet Packet to test.True if dynamic_cast<T*>(packet) succeeds.
virtual const inline
virtual inline PacketRetention retention() constReturns how this adapter treats incoming packet lifetime. Most adapters are synchronous and therefore only borrow the packet for the current call chain. Queue-style adapters override this to advertise that they clone before deferred use. Callers may treat the first adapter reporting Cloned or Retained as the explicit ownership boundary in the stream graph.
| Return | Name | Description |
|---|---|---|
void | dispatch virtual inline | Emits the packet to downstream processors from the async thread. |
void | onStreamStateChange virtual inline | Closes the queue on [Error](icy-Error.html#error) or Closed stream state transitions. |
virtual inline
virtual inline void dispatch(T & packet)Emits the packet to downstream processors from the async thread.
packet Packet to dispatch.virtual inline
virtual inline void onStreamStateChange(const PacketStreamState &)Closes the queue on [Error](icy-Error.html#error) or Closed stream state transitions.
state New stream state.AsyncQueue< T > Queue()PacketProcessor Processor()