Base module
PacketCreationStrategy
This template class implements an adapter that sits between an SignalBase and an object receiving notifications from it.
#include <icy/packetfactory.h>
template<class PacketT>
struct PacketCreationStrategyDefined in src/base/include/icy/packetfactory.h:55
- Inherits
IPacketCreationStrategy
List of all members
| Name | Kind | Owner |
|---|---|---|
PacketCreationStrategy | function | Declared here |
create | function | Declared here |
priority | function | Declared here |
_priority | variable | Declared here |
IPacketCreationStrategy | function | Inherited from IPacketCreationStrategy |
~IPacketCreationStrategy | function | Inherited from IPacketCreationStrategy |
create | function | Inherited from IPacketCreationStrategy |
priority | function | Inherited from IPacketCreationStrategy |
Inherited from IPacketCreationStrategy
| Kind | Name | Description |
|---|---|---|
function | IPacketCreationStrategy | Defaulted constructor. |
function | ~IPacketCreationStrategy virtual | Defaulted destructor. |
function | create virtual const | Attempts to create a typed packet from the given buffer. |
function | priority virtual const | Returns the dispatch priority of this strategy (0–100; higher runs first). |
Public Methods
| Return | Name | Description |
|---|---|---|
PacketCreationStrategy inline | ||
IPacket * | create virtual const inline override | Attempts to default-construct a PacketT, calling its read() method. |
int | priority virtual const inline override |
PacketCreationStrategy
inline
inline PacketCreationStrategy(int priority = 0)Defined in src/base/include/icy/packetfactory.h:59
Parameters
| Parameter | Type | Description |
|---|---|---|
priority | int | Dispatch priority in the range 0–100. |
Exceptions
| Exception | Description |
|---|---|
std::logic_error | if priority exceeds 100. |
create
virtual const inline override
virtual inline IPacket * create(const ConstBuffer & buffer, size_t & nread) const overrideDefined in src/base/include/icy/packetfactory.h:70
Attempts to default-construct a PacketT, calling its read() method.
Returns
Newly allocated PacketT on success, nullptr if read() returns 0.
Reimplements
Parameters
| Parameter | Type | Description |
|---|---|---|
buffer | const ConstBuffer & | Raw input data. |
nread | size_t & | Set to the number of bytes consumed when read() succeeds. |
priority
virtual const inline override
virtual inline int priority() const overrideDefined in src/base/include/icy/packetfactory.h:79
Returns
The priority value assigned at construction.
Reimplements
Protected Attributes
| Return | Name | Description |
|---|---|---|
int | _priority |
_priority
int _priority