#include <uhd/rfnoc/block_id.hpp>
Public Member Functions | |
block_id_t () | |
block_id_t (const std::string &block_str) | |
block_id_t (const size_t device_no, const std::string &block_name, const size_t block_ctr=0) | |
std::string | to_string () const |
Return a string like this: "0/FFT#1" (includes all components, if set) More... | |
bool | match (const std::string &block_str) |
Check if block_str matches this block. More... | |
std::string | get () const |
Short for to_string() More... | |
std::string | get_local () const |
Like get(), but only returns the local part ("FFT#1") More... | |
uhd::fs_path | get_tree_root () const |
Returns the property tree root for this block (e.g. "/mboards/0/xbar/FFT#1/") More... | |
size_t | get_device_no () const |
Return device number. More... | |
size_t | get_block_count () const |
Return block count. More... | |
std::string | get_block_name () const |
Return block name. More... | |
bool | set (const std::string &new_name) |
Set from string such as "0/FFT#1", "FFT#0", ... More... | |
bool | set (const size_t device_no, const std::string &block_name, const size_t block_ctr=0) |
Sets from individual components, like calling set_device_no(), set_block_name() More... | |
void | set_device_no (size_t device_no) |
Set the device number. More... | |
bool | set_block_name (const std::string &block_name) |
Set the block name. Will return false if invalid block string. More... | |
void | set_block_count (size_t count) |
Set the block count. More... | |
block_id_t | operator= (const std::string &new_name) |
Assignment: Works like set(std::string) More... | |
bool | operator== (const block_id_t &block_id) const |
bool | operator!= (const block_id_t &block_id) const |
bool | operator< (const block_id_t &block_id) const |
bool | operator> (const block_id_t &block_id) const |
bool | operator== (const std::string &block_id_str) const |
Check if a string matches the entire block ID (not like match()) More... | |
bool | operator== (const char *block_id_str) const |
Check if a string matches the entire block ID (not like match()) More... | |
operator std::string () const | |
Type-cast operator does the same as to_string() More... | |
block_id_t | operator++ () |
Increment the block count ("FFT#1" -> "FFT_2") More... | |
block_id_t | operator++ (int) |
Increment the block count ("FFT#1" -> "FFT_2") More... | |
Static Public Member Functions | |
static bool | is_valid_blockname (const std::string &block_name) |
Check if a given string is valid as a block name. More... | |
static bool | is_valid_block_id (const std::string &block_id) |
Check if a given string is valid as a block ID. More... | |
Identifies an RFNoC block.
An RFNoC block ID is a string such as: 0/FFT#1
The rules for formatting such a string are:
DEVICE/BLOCKNAME#COUNTER
DEVICE: Identifies the device (usually the motherboard index) BLOCKNAME: A name given to this block COUNTER: If is are more than one block with a BLOCKNAME, this counts up.
So, 0/FFT#1 means we're addressing the second block called FFT on the first device.
This class can represent these block IDs.
uhd::rfnoc::block_id_t::block_id_t | ( | ) |
uhd::rfnoc::block_id_t::block_id_t | ( | const std::string & | block_str | ) |
uhd::rfnoc::block_id_t::block_id_t | ( | const size_t | device_no, |
const std::string & | block_name, | ||
const size_t | block_ctr = 0 |
||
) |
device_no | Device number |
block_name | Block name |
block_ctr | Which block of this type is this on this device? |
|
inline |
Short for to_string()
|
inline |
Return block count.
|
inline |
Return block name.
|
inline |
Return device number.
std::string uhd::rfnoc::block_id_t::get_local | ( | ) | const |
Like get(), but only returns the local part ("FFT#1")
uhd::fs_path uhd::rfnoc::block_id_t::get_tree_root | ( | ) | const |
Returns the property tree root for this block (e.g. "/mboards/0/xbar/FFT#1/")
|
static |
Check if a given string is valid as a block ID.
|
static |
Check if a given string is valid as a block name.
bool uhd::rfnoc::block_id_t::match | ( | const std::string & | block_str | ) |
Check if block_str matches this block.
|
inline |
Type-cast operator does the same as to_string()
|
inline |
|
inline |
Increment the block count ("FFT#1" -> "FFT_2")
|
inline |
Increment the block count ("FFT#1" -> "FFT_2")
|
inline |
|
inline |
Assignment: Works like set(std::string)
|
inline |
|
inline |
Check if a string matches the entire block ID (not like match())
|
inline |
Check if a string matches the entire block ID (not like match())
|
inline |
bool uhd::rfnoc::block_id_t::set | ( | const std::string & | new_name | ) |
Set from string such as "0/FFT#1", "FFT#0", ...
bool uhd::rfnoc::block_id_t::set | ( | const size_t | device_no, |
const std::string & | block_name, | ||
const size_t | block_ctr = 0 |
||
) |
Sets from individual components, like calling set_device_no(), set_block_name()
|
inline |
Set the block count.
bool uhd::rfnoc::block_id_t::set_block_name | ( | const std::string & | block_name | ) |
Set the block name. Will return false if invalid block string.
|
inline |
Set the device number.
std::string uhd::rfnoc::block_id_t::to_string | ( | ) | const |
Return a string like this: "0/FFT#1" (includes all components, if set)