Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
ireader.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/ireader.h
10 //! @brief Packet reader interface.
11 
12 #ifndef ROC_PACKET_IREADER_H_
13 #define ROC_PACKET_IREADER_H_
14 
15 #include "roc_core/attributes.h"
16 #include "roc_packet/packet.h"
17 #include "roc_status/status_code.h"
18 
19 namespace roc {
20 namespace packet {
21 
22 //! Packet reader interface.
23 class IReader {
24 public:
25  virtual ~IReader();
26 
27  //! Read packet.
28  //!
29  //! @returns
30  //! - If a returned code is not status::StatusOK, a packet is never set;
31  //! - If a packet is set, a returned code is always status::StatusOK.
32  //!
33  //! @see status::StatusCode.
35 };
36 
37 } // namespace packet
38 } // namespace roc
39 
40 #endif // ROC_PACKET_IREADER_H_
Compiler attributes.
#define ROC_ATTR_NODISCARD
Emit warning if function result is not checked.
Definition: attributes.h:31
Packet reader interface.
Definition: ireader.h:23
virtual ROC_ATTR_NODISCARD status::StatusCode read(PacketPtr &packet)=0
Read packet.
Root namespace.
Packet.
Status codes.
StatusCode
Status code.
Definition: status_code.h:19