Base module

IPacketCreationStrategy

Abstract strategy for creating typed packets from raw buffer data.

#include <icy/packetfactory.h>

class IPacketCreationStrategy

Defined in src/base/include/icy/packetfactory.h:29

Public Methods

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

IPacketCreationStrategy

IPacketCreationStrategy() = default

Defined in src/base/include/icy/packetfactory.h:32

Defaulted constructor.


~IPacketCreationStrategy

virtual

virtual ~IPacketCreationStrategy() = default

Defined in src/base/include/icy/packetfactory.h:33

Defaulted destructor.


create

virtual const

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

Defined in src/base/include/icy/packetfactory.h:38

Attempts to create a typed packet from the given buffer.

Returns

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

Reimplemented by

Parameters

ParameterTypeDescription
bufferconst ConstBuffer &Raw input data.
nreadsize_t &Set to the number of bytes consumed on success, 0 otherwise.

priority

virtual const

virtual int priority() const

Defined in src/base/include/icy/packetfactory.h:41

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

Reimplemented by