#include <icy/packetqueue.h>Inherits:
SyncQueue< IPacket >,PacketProcessor
Synchronized packet queue for event loop integration.
| Return | Name | Description |
|---|---|---|
PacketSignal | emitter |
PacketSignal emitter| Return | Name | Description |
|---|---|---|
SyncPacketQueue inline | #### Parameters | |
SyncPacketQueue inline | Uses the default libuv event loop. | |
void | process virtual inline | Clones the incoming packet and pushes it onto the queue for synchronized dispatch. 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 SyncPacketQueue(uv::Loop * loop, int maxSize)loop Event loop to synchronize dispatch onto.
maxSize Maximum number of queued packets before oldest are dropped.
inline
inline SyncPacketQueue(int maxSize)Uses the default libuv event loop.
maxSize Maximum number of queued packets before oldest are dropped.virtual inline
virtual inline void process(IPacket & packet)Clones the incoming packet and pushes it onto the queue for synchronized dispatch. 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 event loop thread. |
void | onStreamStateChange virtual inline | Cancels the queue on Closed or [Error](icy-Error.html#error) stream state transitions. |
virtual inline
virtual inline void dispatch(T & packet)Emits the packet to downstream processors from the event loop thread.
packet Packet to dispatch.virtual inline
virtual inline void onStreamStateChange(const PacketStreamState &)Cancels the queue on Closed or [Error](icy-Error.html#error) stream state transitions.
state New stream state.SyncQueue< T > Queue()PacketProcessor Processor()