USRP Hardware Driver and USRP Manual  Version: 3.12.0.0-0-unknown
UHD and USRP Manual
stream_sig.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2014-2015 Ettus Research LLC
3 // Copyright 2018 Ettus Research, a National Instruments Company
4 //
5 // SPDX-License-Identifier: GPL-3.0-or-later
6 //
7 
8 #ifndef INCLUDED_LIBUHD_RFNOC_STREAMSIG_HPP
9 #define INCLUDED_LIBUHD_RFNOC_STREAMSIG_HPP
10 
11 #include <iostream>
12 #include <uhd/config.hpp>
13 
14 namespace uhd { namespace rfnoc {
15 
24  public:
25  /***********************************************************************
26  * Structors
27  ***********************************************************************/
28  stream_sig_t();
29 
30  /***********************************************************************
31  * The stream signature attributes
32  ***********************************************************************/
34  // to empty.
35  std::string item_type;
36 
38  size_t vlen;
39 
41  size_t packet_size;
42 
43  bool is_bursty;
44 
45  /***********************************************************************
46  * Helpers
47  ***********************************************************************/
49  std::string to_string();
51  std::string to_pp_string();
52 
54  // Note: The vector length is *not* considered here.
55  //
56  // \returns Number of bytes per item or 0 if the item type is
57  // undefined.
58  // \throws uhd::key_error if the item type is invalid.
59  size_t get_bytes_per_item() const;
60 
66  static bool is_compatible(const stream_sig_t &output_sig, const stream_sig_t &input_sig);
67 };
68 
70 UHD_INLINE std::ostream& operator<< (std::ostream& out, stream_sig_t stream_sig) {
71  out << stream_sig.to_string().c_str();
72  return out;
73 }
74 
75 }} /* namespace uhd::rfnoc */
76 
77 #endif /* INCLUDED_LIBUHD_RFNOC_STREAMSIG_HPP */
78 // vim: sw=4 et:
std::string to_string()
Compact string representation.
UHD_API size_t get_bytes_per_item(const std::string &format)
Convert an item format to a size in bytes.
std::string item_type
The data type of the individual items (e.g. &#39;sc16&#39;). If undefined, set.
Definition: stream_sig.hpp:35
size_t vlen
The vector length in multiples of items. If undefined, set to zero.
Definition: stream_sig.hpp:38
Definition: build_info.hpp:14
std::ostream & operator<<(std::ostream &out, block_id_t block_id)
Shortcut for << block_id.to_string()
Definition: block_id.hpp:193
#define UHD_RFNOC_API
Definition: config.hpp:93
#define UHD_INLINE
Definition: config.h:53
bool is_bursty
Definition: stream_sig.hpp:43
size_t packet_size
Packet size in bytes. If undefined, set to zero.
Definition: stream_sig.hpp:41
Definition: stream_sig.hpp:23