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
| Return | Name | Description |
|---|---|---|
IPacketCreationStrategy | Defaulted constructor. | |
IPacket * | create const | Attempts to create a typed packet from the given buffer. |
int | priority const | Returns the dispatch priority of this strategy (0–100; higher runs first). |
IPacketCreationStrategy
IPacketCreationStrategy() = defaultDefaulted constructor.
create
const
IPacket * create(const ConstBuffer & buffer, size_t & nread) constAttempts to create a typed packet from the given buffer.
Parameters
bufferRaw input data.nreadSet 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() constReturns the dispatch priority of this strategy (0–100; higher runs first).
