Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Loading...
Searching...
No Matches
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
17#include "roc_core/shared_ptr.h"
18#include "roc_core/slab_pool.h"
19
20namespace roc {
21namespace packet {
22
23class Packet;
24
25//! Packet factory.
27public:
28 //! Constructor.
29 PacketFactory(core::IAllocator& allocator, bool poison);
30
31 //! Create new packet;
33
34private:
36
37 void destroy(Packet&);
38
39 core::SlabPool pool_;
40};
41
42} // namespace packet
43} // namespace roc
44
45#endif // ROC_PACKET_PACKET_FACTORY_H_
Allocation policies.
Allocation policy for objects (de)allocated using speciailized factory.
Memory allocator interface.
Definition iallocator.h:23
Base class for non-copyable objects.
Definition noncopyable.h:23
Shared ownership intrusive pointer.
Definition shared_ptr.h:32
PacketFactory(core::IAllocator &allocator, bool poison)
Constructor.
core::SharedPtr< Packet > new_packet()
Create new packet;.
Root namespace.
Non-copyable object.
Shared ownership intrusive pointer.
Slab pool.