Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
iwriter.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/iwriter.h
10 //! @brief Packet writer interface.
11 
12 #ifndef ROC_PACKET_IWRITER_H_
13 #define ROC_PACKET_IWRITER_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 writer interface.
23 class IWriter {
24 public:
25  virtual ~IWriter();
26 
27  //! Write packet.
28  //!
29  //! @returns
30  //! - If a returned code is not status::StatusOK, a packet is never written;
31  //! - If a packet is written, 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_IWRITER_H_
Compiler attributes.
#define ROC_ATTR_NODISCARD
Emit warning if function result is not checked.
Definition: attributes.h:31
Packet writer interface.
Definition: iwriter.h:23
virtual ROC_ATTR_NODISCARD status::StatusCode write(const PacketPtr &)=0
Write packet.
Root namespace.
Packet.
Status codes.
StatusCode
Status code.
Definition: status_code.h:19