Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
packet_factory.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2022 Roc Streaming 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_factory.h
10
//! @brief Packet factory.
11
12
#ifndef ROC_PACKET_PACKET_FACTORY_H_
13
#define ROC_PACKET_PACKET_FACTORY_H_
14
15
#include "
roc_core/allocation_policy.h
"
16
#include "
roc_core/noncopyable.h
"
17
#include "
roc_core/shared_ptr.h
"
18
#include "
roc_core/slab_pool.h
"
19
#include "
roc_packet/packet.h
"
20
21
namespace
roc
{
22
namespace
packet {
23
24
//! Packet factory.
25
class
PacketFactory
:
public
core::NonCopyable
<> {
26
public
:
27
//! Constructor.
28
PacketFactory
(
core::IArena
& arena);
29
30
//! Create new packet;
31
core::SharedPtr<Packet>
new_packet
();
32
33
private
:
34
core::SlabPool<Packet>
pool_;
35
};
36
37
}
// namespace packet
38
}
// namespace roc
39
40
#endif
// ROC_PACKET_PACKET_FACTORY_H_
allocation_policy.h
Allocation policies.
roc::core::IArena
Memory arena interface.
Definition:
iarena.h:23
roc::core::NonCopyable
Base class for non-copyable objects.
Definition:
noncopyable.h:23
roc::core::SharedPtr< Packet >
roc::core::SlabPool
Memory pool.
Definition:
slab_pool.h:65
roc::packet::PacketFactory
Packet factory.
Definition:
packet_factory.h:25
roc::packet::PacketFactory::new_packet
core::SharedPtr< Packet > new_packet()
Create new packet;.
roc::packet::PacketFactory::PacketFactory
PacketFactory(core::IArena &arena)
Constructor.
roc
Root namespace.
noncopyable.h
Non-copyable object.
packet.h
Packet.
shared_ptr.h
Shared ownership intrusive pointer.
slab_pool.h
Memory pool.
roc_packet
packet_factory.h
Generated by
1.9.1