18 #ifndef INCLUDED_UHD_TYPES_SID_HPP 19 #define INCLUDED_UHD_TYPES_SID_HPP 23 #include <boost/shared_ptr.hpp> 87 sid_t(uint8_t src_addr, uint8_t src_ep, uint8_t dst_addr, uint8_t dst_ep);
89 sid_t(
const std::string &);
92 std::string to_pp_string()
const;
94 std::string to_pp_string_hex()
const;
97 bool is_set()
const {
return _set; };
107 return (_sid >> 16) & 0xFFFF;
111 return _sid & 0xFFFF;
115 return (get_src() >> 8) & 0xFF;
119 return get_src() & 0xFF;
123 return (get_src_endpoint() >> 4) & 0xF;
127 return (get_src_endpoint()) & 0xF;
131 return (get_dst() >> 8) & 0xFF;
135 return get_dst() & 0xFF;
139 return (get_dst_endpoint() >> 4) & 0xF;
143 return (get_dst_endpoint()) & 0xF;
149 void set(uint32_t new_sid) { set_sid(new_sid); };
153 void set_from_str(
const std::string &);
154 void set_sid(uint32_t new_sid);
157 void set_src(uint32_t new_addr);
160 void set_dst(uint32_t new_addr);
161 void set_src_addr(uint32_t new_addr);
162 void set_src_endpoint(uint32_t new_addr);
163 void set_dst_addr(uint32_t new_addr);
164 void set_dst_endpoint(uint32_t new_addr);
165 void set_dst_xbarport(uint32_t new_xbarport);
166 void set_dst_blockport(uint32_t new_blockport);
178 sid_t operator = (uint32_t new_sid) {
188 sid_t operator = (
const std::string &sid_str) {
189 set_from_str(sid_str);
194 return (not _set and not sid.
is_set()) or (_sid == sid.
get_sid());
198 return _set and _sid == sid;
211 operator uint32_t()
const {
215 operator bool()
const {
226 std::ios_base::fmtflags ff = out.flags();
227 if (ff & std::ios::hex) {
UHD_INLINE Range reversed(const Range &range)
Definition: algorithm.hpp:56
UHD_INLINE uint32_t get_dst_xbarport() const
Return crossbar port of the source.
Definition: sid.hpp:138
UHD_INLINE uint32_t get_src_xbarport() const
Return crossbar port of the source.
Definition: sid.hpp:122
UHD_INLINE uint32_t get_src() const
Return the 16-bit source address of this SID.
Definition: sid.hpp:106
UHD_INLINE uint32_t get_dst_addr() const
Return 8-bit address of the destination.
Definition: sid.hpp:130
UHD_INLINE uint32_t get_sid() const
Returns a 32-Bit representation of the SID if set, or zero otherwise.
Definition: sid.hpp:104
UHD_INLINE uint32_t get_dst() const
Return the 16-bit destination address of this SID.
Definition: sid.hpp:110
UHD_INLINE uint32_t get_src_blockport() const
Return block port of the source.
Definition: sid.hpp:126
Definition: build_info.hpp:25
UHD_INLINE uint32_t get_src_addr() const
Return 8-bit address of the source.
Definition: sid.hpp:114
std::string to_pp_string() const
Return a decimal string representation of the SID.
UHD_INLINE uint32_t get_src_endpoint() const
Return endpoint of the source.
Definition: sid.hpp:118
Represents a stream ID (SID).
Definition: sid.hpp:79
#define UHD_INLINE
Definition: config.h:63
#define UHD_API
Definition: config.h:73
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
UHD_INLINE uint32_t get_dst_endpoint() const
Return endpoint of the destination.
Definition: sid.hpp:134
UHD_API bool operator==(const time_spec_t &, const time_spec_t &)
Implement equality_comparable interface.
std::string to_pp_string_hex() const
Return a hexadecimal string representation of the SID.
UHD_INLINE uint32_t get_dst_blockport() const
Return block port of the source.
Definition: sid.hpp:142