Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
connection_data.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019 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_sdp/connection_data.h
10 //! @brief Connection field in a SDP.
11 
12 #ifndef ROC_SDP_CONNECTION_DATA_H_
13 #define ROC_SDP_CONNECTION_DATA_H_
14 
16 #include "roc_core/attributes.h"
17 #include "roc_core/list_node.h"
18 #include "roc_core/log.h"
19 #include "roc_core/string_buffer.h"
21 
22 namespace roc {
23 namespace sdp {
24 
25 //! SDP connection data field.
27 public:
28  //! Initialize empty connection data.
30 
31  //! Clear all fields.
32  void clear();
33 
34  //! Check and set connection address from a string.
36  set_connection_address(address::AddrFamily addrtype, const char* str, size_t str_len);
37 
38  //! The SocketAddr of the ConnectionData.
40 
41 private:
42  address::SocketAddr connection_address_;
43 };
44 
45 } // namespace sdp
46 } // namespace roc
47 
48 #endif // ROC_SDP_CONNECTION_DATA_H_
Compiler attributes.
#define ROC_ATTR_NODISCARD
Emit warning if function result is not checked.
Definition: attributes.h:31
Socket address.
Definition: socket_addr.h:26
SDP connection data field.
ConnectionData()
Initialize empty connection data.
void clear()
Clear all fields.
const address::SocketAddr & connection_address() const
The SocketAddr of the ConnectionData.
ROC_ATTR_NODISCARD bool set_connection_address(address::AddrFamily addrtype, const char *str, size_t str_len)
Check and set connection address from a string.
Linked list node.
Logging.
AddrFamily
Address family.
Definition: addr_family.h:19
Root namespace.
Socket address.
String buffer.
String builder.