USRP Hardware Driver and USRP Manual Version: 3.15.0.0-MacPorts-Release
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 <uhd/config.hpp>
12#include <iostream>
13
14namespace uhd { namespace rfnoc {
15
24{
25public:
26 /***********************************************************************
27 * Structors
28 ***********************************************************************/
30
31 /***********************************************************************
32 * The stream signature attributes
33 ***********************************************************************/
35 // to empty.
36 std::string item_type;
37
39 size_t vlen;
40
43
45
46 /***********************************************************************
47 * Helpers
48 ***********************************************************************/
50 std::string to_string();
52 std::string to_pp_string();
53
55 // Note: The vector length is *not* considered here.
56 //
57 // \returns Number of bytes per item or 0 if the item type is
58 // undefined.
59 // \throws uhd::key_error if the item type is invalid.
60 size_t get_bytes_per_item() const;
61
67 static bool is_compatible(
68 const stream_sig_t& output_sig, const stream_sig_t& input_sig);
69};
70
72UHD_INLINE std::ostream& operator<<(std::ostream& out, stream_sig_t stream_sig)
73{
74 out << stream_sig.to_string().c_str();
75 return out;
76}
77
78}} /* namespace uhd::rfnoc */
79
80#endif /* INCLUDED_LIBUHD_RFNOC_STREAMSIG_HPP */
Definition: stream_sig.hpp:24
std::string item_type
The data type of the individual items (e.g. 'sc16'). If undefined, set.
Definition: stream_sig.hpp:36
size_t get_bytes_per_item() const
Returns the number of bytes necessary to store one item.
size_t vlen
The vector length in multiples of items. If undefined, set to zero.
Definition: stream_sig.hpp:39
bool is_bursty
Definition: stream_sig.hpp:44
std::string to_string()
Compact string representation.
std::string to_pp_string()
Pretty-print string representation.
size_t packet_size
Packet size in bytes. If undefined, set to zero.
Definition: stream_sig.hpp:42
static bool is_compatible(const stream_sig_t &output_sig, const stream_sig_t &input_sig)
#define UHD_INLINE
Definition: config.h:53
#define UHD_RFNOC_API
Definition: config.hpp:117
std::ostream & operator<<(std::ostream &out, block_id_t block_id)
Shortcut for << block_id.to_string()
Definition: block_id.hpp:227
Definition: build_info.hpp:13