#include <icy/packet.h>Inherits:
IPacketSubclassed by:MediaPacket,SocketPacket
RawPacket is the default data packet type which consists of an optionally managed char pointer and a size value.
| Return | Name | Description |
|---|---|---|
RawPacket inline | Construct with borrowed (non-owning) buffer. | |
RawPacket inline | Construct with const data (copied, owning). | |
RawPacket inline | Copy constructor (always copies data). | |
std::unique_ptr< IPacket > | clone virtual const inline | #### Returns |
void | copyData virtual inline | Copies data into an internally owned buffer, replacing any prior content. |
ssize_t | read virtual inline | Reads from the buffer by copying its contents into an owned buffer. |
void | write virtual const inline | Appends the packet data to the given output buffer. |
char * | data virtual const inline | #### Returns |
size_t | size virtual const inline | #### Returns |
const char * | className virtual const inline | Returns the class name of this packet type for logging and diagnostics. |
bool | ownsBuffer const inline | #### Returns |
inline
inline RawPacket(char * data, size_t size, unsigned flags, std::unique_ptr< IPacketInfo > info)Construct with borrowed (non-owning) buffer.
inline
inline RawPacket(const char * data, size_t size, unsigned flags, std::unique_ptr< IPacketInfo > info)Construct with const data (copied, owning).
inline
inline RawPacket(const RawPacket & that)Copy constructor (always copies data).
virtual const inline
virtual inline std::unique_ptr< IPacket > clone() constOwning pointer to a deep copy of this packet (always copies data).
virtual inline
virtual inline void copyData(const void * data, size_t size)Copies data into an internally owned buffer, replacing any prior content.
data Source data pointer.
size Number of bytes to copy.
virtual inline
virtual inline ssize_t read(const ConstBuffer & buf)Reads from the buffer by copying its contents into an owned buffer.
buf Input buffer to read from.Number of bytes consumed (equal to buf.size()).
virtual const inline
virtual inline void write(Buffer & buf) constAppends the packet data to the given output buffer.
buf Buffer to write into.virtual const inline
virtual inline char * data() constMutable pointer to the raw packet data, or nullptr if empty.
virtual const inline
virtual inline size_t size() constSize of the packet data in bytes.
virtual const inline
virtual inline const char * className() constReturns the class name of this packet type for logging and diagnostics.
const inline
inline bool ownsBuffer() constTrue if this packet owns (manages) its data buffer.
char * _datasize_t _sizestd::unique_ptr< char[]> _owned