Home
Base module

IPacketCreationStrategy

Abstract strategy for creating typed packets from raw buffer data.

IPacketCreationStrategy

#include <icy/packetfactory.h>
class IPacketCreationStrategy

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

Subclassed by: PacketCreationStrategy< PacketT >

Abstract strategy for creating typed packets from raw buffer data.

List of all members

NameKindOwner
IPacketCreationStrategyfunctionDeclared here
~IPacketCreationStrategyfunctionDeclared here
createfunctionDeclared here
priorityfunctionDeclared here

Public Methods

ReturnNameDescription
IPacketCreationStrategyDefaulted constructor.
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.


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.

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.

Reimplemented by

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