Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Loading...
Searching...
No Matches
packet_pool.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2017 Roc authors
3 *
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 */
8
9//! @file roc_packet/packet_pool.h
10//! @brief Packet pool.
11
12#ifndef ROC_PACKET_PACKET_POOL_H_
13#define ROC_PACKET_PACKET_POOL_H_
14
15#include "roc_core/pool.h"
16#include "roc_packet/packet.h"
17
18namespace roc {
19namespace packet {
20
21//! Packet pool.
22class PacketPool : public core::Pool<Packet> {
23public:
24 //! Constructor.
25 PacketPool(core::IAllocator& allocator, bool poison)
26 : core::Pool<Packet>(allocator, sizeof(Packet), poison) {
27 }
28};
29
30} // namespace packet
31} // namespace roc
32
33#endif // ROC_PACKET_PACKET_POOL_H_
Memory allocator interface.
Definition: iallocator.h:23
Pool.
Definition: pool.h:35
Pool(IAllocator &allocator, size_t object_size, bool poison)
Initialization.
Definition: pool.h:43
PacketPool(core::IAllocator &allocator, bool poison)
Constructor.
Definition: packet_pool.h:25
Root namespace.
Packet.
Pool.