Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
|
#include <packet_factory.h>
Public Member Functions | |
PacketFactory (core::IArena &arena, size_t buffer_size) | |
Initialize with default pools. buffer_size defines number of bytes in packet buffer. More... | |
PacketFactory (core::IPool &packet_pool, core::IPool &buffer_pool) | |
Initialize with custom pools. packet_pool is a pool of packet::Packet objects. buffer_pool is a pool of core::Buffer objects. More... | |
size_t | packet_buffer_size () const |
Get packet buffer size in bytes. More... | |
core::BufferPtr | new_packet_buffer () |
Allocate packet buffer. More... | |
PacketPtr | new_packet () |
Allocate packet. More... | |
Packet factory.
Allows allocating packets and packet buffers (byte buffers of appropriate size that should be attached to packet to hold payload).
Serves several purposes:
Definition at line 36 of file packet_factory.h.
roc::packet::PacketFactory::PacketFactory | ( | core::IArena & | arena, |
size_t | buffer_size | ||
) |
Initialize with default pools. buffer_size
defines number of bytes in packet buffer.
roc::packet::PacketFactory::PacketFactory | ( | core::IPool & | packet_pool, |
core::IPool & | buffer_pool | ||
) |
Initialize with custom pools. packet_pool
is a pool of packet::Packet objects. buffer_pool
is a pool of core::Buffer objects.
PacketPtr roc::packet::PacketFactory::new_packet | ( | ) |
Allocate packet.
core::BufferPtr roc::packet::PacketFactory::new_packet_buffer | ( | ) |
Allocate packet buffer.
size_t roc::packet::PacketFactory::packet_buffer_size | ( | ) | const |
Get packet buffer size in bytes.