Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Toggle main menu visibility
Loading...
Searching...
No Matches
queue.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2015 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/queue.h
10
//! @brief Packet queue.
11
12
#ifndef ROC_PACKET_QUEUE_H_
13
#define ROC_PACKET_QUEUE_H_
14
15
#include "
roc_core/list.h
"
16
#include "
roc_core/noncopyable.h
"
17
#include "
roc_packet/ireader.h
"
18
#include "
roc_packet/iwriter.h
"
19
#include "
roc_packet/packet.h
"
20
21
namespace
roc
{
22
namespace
packet
{
23
24
//! Packet queue.
25
class
Queue
:
public
IReader
,
public
IWriter
,
public
core::NonCopyable
<> {
26
public
:
27
//! Read next packet.
28
virtual
ROC_ATTR_NODISCARD
status::StatusCode
read
(
PacketPtr
&
packet
);
29
30
//! Add packet to the queue.
31
//! @remarks
32
//! Adds packet to the end of the queue.
33
virtual
ROC_ATTR_NODISCARD
status::StatusCode
write
(
const
PacketPtr
&
packet
);
34
35
//! Get number of packets in queue.
36
size_t
size
()
const
;
37
38
private
:
39
core::List<Packet>
list_;
40
};
41
42
}
// namespace packet
43
}
// namespace roc
44
45
#endif
// ROC_PACKET_QUEUE_H_
ROC_ATTR_NODISCARD
#define ROC_ATTR_NODISCARD
Emit warning if function result is not checked.
Definition
attributes.h:31
roc::core::List
Intrusive doubly-linked list.
Definition
list.h:40
roc::core::NonCopyable
Base class for non-copyable objects.
Definition
noncopyable.h:23
roc::packet::IReader
Packet reader interface.
Definition
ireader.h:23
roc::packet::IWriter
Packet writer interface.
Definition
iwriter.h:23
roc::packet::Queue
Packet queue.
Definition
queue.h:25
roc::packet::Queue::size
size_t size() const
Get number of packets in queue.
roc::packet::Queue::read
virtual ROC_ATTR_NODISCARD status::StatusCode read(PacketPtr &packet)
Read next packet.
roc::packet::Queue::write
virtual ROC_ATTR_NODISCARD status::StatusCode write(const PacketPtr &packet)
Add packet to the queue.
ireader.h
Packet reader interface.
iwriter.h
Packet writer interface.
list.h
Intrusive doubly-linked list.
roc::packet
Network packets and packet processing.
roc::packet::PacketPtr
core::SharedPtr< Packet > PacketPtr
Packet smart pointer.
Definition
packet.h:34
roc
Root namespace.
noncopyable.h
Non-copyable object.
packet.h
Packet.
roc::status::StatusCode
StatusCode
Status code.
Definition
status_code.h:19
roc_packet
queue.h
Generated by
1.17.0