8 #ifndef INCLUDED_UHD_TYPES_SID_HPP 9 #define INCLUDED_UHD_TYPES_SID_HPP 82 sid_t(uint8_t src_addr, uint8_t src_ep, uint8_t dst_addr, uint8_t dst_ep);
84 sid_t(
const std::string&);
92 std::string to_pp_string()
const;
94 std::string to_pp_string_hex()
const;
105 inline uint32_t
get()
const 112 return _set ? _sid : 0;
117 return (_sid >> 16) & 0xFFFF;
122 return _sid & 0xFFFF;
127 return (get_src() >> 8) & 0xFF;
132 return get_src() & 0xFF;
137 return (get_src_endpoint() >> 4) & 0xF;
142 return (get_src_endpoint()) & 0xF;
147 return (get_dst() >> 8) & 0xFF;
152 return get_dst() & 0xFF;
157 return (get_dst_endpoint() >> 4) & 0xF;
162 return (get_dst_endpoint()) & 0xF;
168 void set(uint32_t new_sid)
175 void set_from_str(
const std::string&);
176 void set_sid(uint32_t new_sid);
179 void set_src(uint32_t new_addr);
182 void set_dst(uint32_t new_addr);
183 void set_src_addr(uint32_t new_addr);
184 void set_src_endpoint(uint32_t new_addr);
185 void set_dst_addr(uint32_t new_addr);
186 void set_dst_endpoint(uint32_t new_addr);
187 void set_dst_xbarport(uint32_t new_xbarport);
188 void set_dst_blockport(uint32_t new_blockport);
214 set_from_str(sid_str);
220 return (not _set and not sid.
is_set()) or (_sid == sid.
get_sid());
225 return _set and _sid == sid;
239 operator uint32_t()
const 244 operator bool()
const 257 std::ios_base::fmtflags ff = out.flags();
258 if (ff & std::ios::hex) {
UHD_INLINE Range reversed(const Range &range)
Definition: algorithm.hpp:49
uint32_t get_sid() const
Returns a 32-Bit representation of the SID if set, or zero otherwise.
Definition: sid.hpp:110
uint32_t get_dst_addr() const
Return 8-bit address of the destination.
Definition: sid.hpp:145
bool operator==(uint32_t sid) const
Definition: sid.hpp:223
sid_t operator=(const sid_t &sid)
Definition: sid.hpp:206
sid_t operator=(const std::string &sid_str)
Definition: sid.hpp:212
uint32_t get_src_addr() const
Return 8-bit address of the source.
Definition: sid.hpp:125
uint32_t get_dst_blockport() const
Return block port of the source.
Definition: sid.hpp:160
Definition: build_info.hpp:13
sid_t(const sid_t &sid)
Copy a sid.
Definition: sid.hpp:87
std::string to_pp_string() const
Return a decimal string representation of the SID.
uint32_t get_src_endpoint() const
Return endpoint of the source.
Definition: sid.hpp:130
uint32_t get_src() const
Return the 16-bit source address of this SID.
Definition: sid.hpp:115
uint32_t get_dst() const
Return the 16-bit destination address of this SID.
Definition: sid.hpp:120
Represents a stream ID (SID).
Definition: sid.hpp:74
uint32_t get_dst_xbarport() const
Return crossbar port of the source.
Definition: sid.hpp:155
bool operator==(const sid_t &sid) const
Definition: sid.hpp:218
#define UHD_API
Definition: config.h:68
bool operator==(const std::string &sid_str) const
Definition: sid.hpp:228
UHD_API std::ostream & operator<<(std::ostream &os, filter_info_base &f)
bool is_set() const
Returns true if this actually holds a valid SID.
Definition: sid.hpp:97
uint32_t get_dst_endpoint() const
Return endpoint of the destination.
Definition: sid.hpp:150
uint32_t get_src_blockport() const
Return block port of the source.
Definition: sid.hpp:140
std::string to_pp_string_hex() const
Return a hexadecimal string representation of the SID.
uint32_t get_src_xbarport() const
Return crossbar port of the source.
Definition: sid.hpp:135
sid_t operator=(const uint32_t new_sid)
Definition: sid.hpp:200