Base module

IPacketCreationStrategy

Abstract strategy for creating typed packets from raw buffer data.

IPacketCreationStrategy

#include <icy/packetfactory.h>

Subclassed by: PacketCreationStrategy< PacketT >

Abstract strategy for creating typed packets from raw buffer data.

Public Methods

ReturnNameDescription
IPacketCreationStrategyDefaulted constructor.
IPacket *create constAttempts to create a typed packet from the given buffer.
intpriority constReturns the dispatch priority of this strategy (0–100; higher runs first).

IPacketCreationStrategy

IPacketCreationStrategy() = default

Defaulted constructor.


create

const

IPacket * create(const ConstBuffer & buffer, size_t & nread) const

Attempts to create a typed packet from the given buffer.

Parameters

  • buffer Raw input data.

  • nread Set to the number of bytes consumed on success, 0 otherwise.

Returns

Newly allocated packet on success, nullptr if the buffer does not match.


priority

const

int priority() const

Returns the dispatch priority of this strategy (0–100; higher runs first).