USRP Hardware Driver and USRP Manual  Version: 4.6.0.0-7-gece7c4811
UHD and USRP Manual
uhd::rfnoc::block_id_t Class Reference

#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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ block_id_t() [1/3]

uhd::rfnoc::block_id_t::block_id_t ( )

◆ block_id_t() [2/3]

uhd::rfnoc::block_id_t::block_id_t ( const std::string &  block_str)

◆ block_id_t() [3/3]

uhd::rfnoc::block_id_t::block_id_t ( const size_t  device_no,
const std::string &  block_name,
const size_t  block_ctr = 0 
)
Parameters
device_noDevice number
block_nameBlock name
block_ctrWhich block of this type is this on this device?

Member Function Documentation

◆ get()

std::string uhd::rfnoc::block_id_t::get ( void  ) const
inline

Short for to_string()

◆ get_block_count()

size_t uhd::rfnoc::block_id_t::get_block_count ( ) const
inline

Return block count.

◆ get_block_name()

std::string uhd::rfnoc::block_id_t::get_block_name ( ) const
inline

Return block name.

◆ get_device_no()

size_t uhd::rfnoc::block_id_t::get_device_no ( ) const
inline

Return device number.

◆ get_local()

std::string uhd::rfnoc::block_id_t::get_local ( ) const

Like get(), but only returns the local part ("FFT#1")

◆ get_tree_root()

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/")

◆ is_valid_block_id()

static bool uhd::rfnoc::block_id_t::is_valid_block_id ( const std::string &  block_id)
static

Check if a given string is valid as a block ID.

◆ is_valid_blockname()

static 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.

◆ match()

bool uhd::rfnoc::block_id_t::match ( const std::string &  block_str)

Check if block_str matches this block.

◆ operator std::string()

uhd::rfnoc::block_id_t::operator std::string ( ) const
inline

Type-cast operator does the same as to_string()

◆ operator!=()

bool uhd::rfnoc::block_id_t::operator!= ( const block_id_t block_id) const
inline

◆ operator++() [1/2]

block_id_t uhd::rfnoc::block_id_t::operator++ ( )
inline

Increment the block count ("FFT#1" -> "FFT_2")

◆ operator++() [2/2]

block_id_t uhd::rfnoc::block_id_t::operator++ ( int  )
inline

Increment the block count ("FFT#1" -> "FFT_2")

◆ operator<()

bool uhd::rfnoc::block_id_t::operator< ( const block_id_t block_id) const
inline

◆ operator=()

block_id_t uhd::rfnoc::block_id_t::operator= ( const std::string &  new_name)
inline

Assignment: Works like set(std::string)

◆ operator==() [1/3]

bool uhd::rfnoc::block_id_t::operator== ( const block_id_t block_id) const
inline

◆ operator==() [2/3]

bool uhd::rfnoc::block_id_t::operator== ( const std::string &  block_id_str) const
inline

Check if a string matches the entire block ID (not like match())

◆ operator==() [3/3]

bool uhd::rfnoc::block_id_t::operator== ( const char *  block_id_str) const
inline

Check if a string matches the entire block ID (not like match())

◆ operator>()

bool uhd::rfnoc::block_id_t::operator> ( const block_id_t block_id) const
inline

◆ set() [1/2]

bool uhd::rfnoc::block_id_t::set ( const std::string &  new_name)

Set from string such as "0/FFT#1", "FFT#0", ...

◆ set() [2/2]

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()

◆ set_block_count()

void uhd::rfnoc::block_id_t::set_block_count ( size_t  count)
inline

Set the block count.

◆ set_block_name()

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.

◆ set_device_no()

void uhd::rfnoc::block_id_t::set_device_no ( size_t  device_no)
inline

Set the device number.

◆ to_string()

std::string uhd::rfnoc::block_id_t::to_string ( ) const

Return a string like this: "0/FFT#1" (includes all components, if set)


The documentation for this class was generated from the following file: