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.
|
| | 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).
|
| bool | match (const std::string &block_str) |
| | Check if block_str matches this block.
|
| std::string | get () const |
| | Short for to_string().
|
| std::string | get_local () const |
| | Like get(), but only returns the local part ("FFT#1").
|
| uhd::fs_path | get_tree_root () const |
| | Returns the property tree root for this block (e.g. "/mboards/0/xbar/FFT#1/").
|
| size_t | get_device_no () const |
| | Return device number.
|
| size_t | get_block_count () const |
| | Return block count.
|
| std::string | get_block_name () const |
| | Return block name.
|
| bool | set (const std::string &new_name) |
| | Set from string such as "0/FFT#1", "FFT#0", ... Returns true if successful (i.e. if string valid).
|
| bool | set (const size_t device_no, const std::string &block_name, const size_t block_ctr=0) |
| void | set_device_no (size_t device_no) |
| | Set the device number.
|
| bool | set_block_name (const std::string &block_name) |
| | Set the block name. Will return false if invalid block string.
|
| void | set_block_count (size_t count) |
| | Set the block count.
|
| block_id_t | operator= (const std::string &new_name) |
| | Assignment: Works like set(std::string).
|
| 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()).
|
| bool | operator== (const char *block_id_str) const |
| | Check if a string matches the entire block ID (not like match()).
|
| block_id_t | operator++ () |
| | Increment the block count ("FFT#1" -> "FFT_2").
|
| block_id_t | operator++ (int) |
| | Increment the block count ("FFT#1" -> "FFT_2").
|
| bool uhd::rfnoc::block_id_t::is_valid_blockname |
( |
const std::string & | block_name | ) |
|
|
static |
Check if a given string is valid as a block name.
Note: This only applies to the block name, not the entire block ID. Examples:
- is_valid_blockname("FFT") will return true.
- is_valid_blockname("FIR#Filter") will return false, because a # symbol is not allowed in a block name. Only alphanumerical characters and underscores are allowed.
Internally, this matches the string with uhd::rfnoc::VALID_BLOCKNAME_REGEX.
| bool uhd::rfnoc::block_id_t::match |
( |
const std::string & | block_str | ) |
|
Check if block_str matches this block.
A match is a less strict version of equality. Less specific block IDs will match more specific ones, e.g. "FFT" will match "0/FFT#1", "1/FFT#2", etc. "FFT#1" will only match the former, etc.