USRP Hardware Driver and USRP Manual  Version: 3.15.0.HEAD-0-gaea0e2de
UHD and USRP Manual
uhd::rfnoc::node_ctrl_base Class Reference

#include <uhd/rfnoc/node_ctrl_base.hpp>

Inheritance diagram for uhd::rfnoc::node_ctrl_base:
uhd::rfnoc::block_ctrl_base uhd::rfnoc::rate_node_ctrl uhd::rfnoc::scalar_node_ctrl uhd::rfnoc::sink_node_ctrl uhd::rfnoc::source_node_ctrl uhd::rfnoc::terminator_node_ctrl uhd::rfnoc::tick_node_ctrl uhd::rfnoc::sink_block_ctrl_base uhd::rfnoc::source_block_ctrl_base uhd::rfnoc::ddc_block_ctrl uhd::rfnoc::duc_block_ctrl uhd::rfnoc::radio_ctrl uhd::rfnoc::ddc_block_ctrl uhd::rfnoc::duc_block_ctrl uhd::rfnoc::sink_block_ctrl_base uhd::rfnoc::source_block_ctrl_base uhd::rfnoc::radio_ctrl uhd::rfnoc::radio_ctrl

Public Types

typedef boost::shared_ptr< node_ctrl_basesptr
 
typedef boost::weak_ptr< node_ctrl_basewptr
 
typedef std::map< size_t, wptrnode_map_t
 
typedef std::pair< size_t, wptrnode_map_pair_t
 
typedef boost::function< void(void)> graph_update_cb_t
 

Public Member Functions

virtual std::string unique_id () const
 Returns a unique string that identifies this block. More...
 
virtual void clear ()
 
node_map_t list_downstream_nodes ()
 
node_map_t list_upstream_nodes ()
 
void disconnect ()
 
void disconnect_output_port (const size_t output_port)
 
void disconnect_input_port (const size_t input_port)
 
void set_downstream_port (const size_t this_port, const size_t remote_port)
 
size_t get_downstream_port (const size_t this_port)
 
void set_upstream_port (const size_t this_port, const size_t remote_port)
 
size_t get_upstream_port (const size_t this_port)
 
template<typename T >
UHD_INLINE std::vector< boost::shared_ptr< T > > find_downstream_node (bool active_only=false)
 
template<typename T >
UHD_INLINE std::vector< boost::shared_ptr< T > > find_upstream_node (bool active_only=false)
 
template<typename T , typename value_type >
UHD_INLINE value_type find_downstream_unique_property (boost::function< value_type(boost::shared_ptr< T > node, size_t port)> get_property, value_type null_value, const std::set< boost::shared_ptr< T > > &exclude_nodes=std::set< boost::shared_ptr< T > >())
 
template<typename T , typename value_type >
UHD_INLINE value_type find_upstream_unique_property (boost::function< value_type(boost::shared_ptr< T > node, size_t port)> get_property, value_type null_value, const std::set< boost::shared_ptr< T > > &exclude_nodes=std::set< boost::shared_ptr< T > >())
 

Protected Member Functions

 node_ctrl_base (void)
 
virtual ~node_ctrl_base ()
 
virtual void _register_downstream_node (node_ctrl_base::sptr downstream_node, size_t port)
 
virtual void _register_upstream_node (node_ctrl_base::sptr upstream_node, size_t port)
 
void update_graph ()
 

Protected Attributes

uhd::device_addr_t _args
 Stores default arguments. More...
 
node_map_t _upstream_nodes
 List of upstream nodes. More...
 
node_map_t _downstream_nodes
 List of downstream nodes. More...
 
size_t _num_input_ports
 
size_t _num_output_ports
 
std::map< size_t, bool > _rx_streamer_active
 
std::map< size_t, bool > _tx_streamer_active
 

Friends

class uhd::usrp::device3_impl
 

Member Typedef Documentation

◆ graph_update_cb_t

typedef boost::function<void(void)> uhd::rfnoc::node_ctrl_base::graph_update_cb_t

◆ node_map_pair_t

◆ node_map_t

typedef std::map<size_t, wptr> uhd::rfnoc::node_ctrl_base::node_map_t

◆ sptr

◆ wptr

Constructor & Destructor Documentation

◆ node_ctrl_base()

uhd::rfnoc::node_ctrl_base::node_ctrl_base ( void  )
inlineprotected

◆ ~node_ctrl_base()

virtual uhd::rfnoc::node_ctrl_base::~node_ctrl_base ( )
inlineprotectedvirtual

Member Function Documentation

◆ _register_downstream_node()

virtual void uhd::rfnoc::node_ctrl_base::_register_downstream_node ( node_ctrl_base::sptr  downstream_node,
size_t  port 
)
protectedvirtual

Registers another node as downstream of this node, connected to a given port.

This implies that this node is a source node, and the downstream node is a sink node. See also uhd::rfnoc::source_node_ctrl::_register_downstream_node().

◆ _register_upstream_node()

virtual void uhd::rfnoc::node_ctrl_base::_register_upstream_node ( node_ctrl_base::sptr  upstream_node,
size_t  port 
)
protectedvirtual

Registers another node as upstream of this node, connected to a given port.

This implies that this node is a sink node, and the upstream node is a source node. See also uhd::rfnoc::sink_node_ctrl::_register_upstream_node().

◆ clear()

virtual void uhd::rfnoc::node_ctrl_base::clear ( )
virtual

Clears the list of connected nodes.

Reimplemented in uhd::rfnoc::block_ctrl_base.

◆ disconnect()

void uhd::rfnoc::node_ctrl_base::disconnect ( )

Disconnect this node from all neighbouring nodes.

◆ disconnect_input_port()

void uhd::rfnoc::node_ctrl_base::disconnect_input_port ( const size_t  input_port)

Identify input_port as unconnected

◆ disconnect_output_port()

void uhd::rfnoc::node_ctrl_base::disconnect_output_port ( const size_t  output_port)

Identify output_port as unconnected

◆ find_downstream_node()

template<typename T >
UHD_INLINE std::vector<boost::shared_ptr<T> > uhd::rfnoc::node_ctrl_base::find_downstream_node ( bool  active_only = false)
inline

Find nodes downstream that match a predicate.

Uses a non-recursive breadth-first search algorithm. On every branch, the search stops if a block matches. See this example:

A -> B -> C -> C

Say node A searches for nodes of type C. It will only find the first 'C' block, not the second.

Returns blocks that are of type T.

Search only goes downstream.

◆ find_downstream_unique_property()

template<typename T , typename value_type >
UHD_INLINE value_type uhd::rfnoc::node_ctrl_base::find_downstream_unique_property ( boost::function< value_type(boost::shared_ptr< T > node, size_t port)>  get_property,
value_type  null_value,
const std::set< boost::shared_ptr< T > > &  exclude_nodes = std::set<boost::shared_ptr<T> >() 
)
inline

Checks if downstream nodes share a common, unique property.

This will use find_downstream_node() to find all nodes downstream of this that are of type T. Then it will use get_property to return a property from all of them. If all these properties are identical, it will return that property. Otherwise, it will throw a uhd::runtime_error.

get_property A functor to return the property from a node null_value If get_property returns this value, that node is skipped. explored_nodes A list of nodes to exclude from the search. This is typically to avoid recursion loops.

◆ find_upstream_node()

template<typename T >
UHD_INLINE std::vector<boost::shared_ptr<T> > uhd::rfnoc::node_ctrl_base::find_upstream_node ( bool  active_only = false)
inline

Same as find_downstream_node(), but only search upstream.

◆ find_upstream_unique_property()

template<typename T , typename value_type >
UHD_INLINE value_type uhd::rfnoc::node_ctrl_base::find_upstream_unique_property ( boost::function< value_type(boost::shared_ptr< T > node, size_t port)>  get_property,
value_type  null_value,
const std::set< boost::shared_ptr< T > > &  exclude_nodes = std::set<boost::shared_ptr<T> >() 
)
inline

Like find_downstream_unique_property(), but searches upstream.

◆ get_downstream_port()

size_t uhd::rfnoc::node_ctrl_base::get_downstream_port ( const size_t  this_port)

Return the remote port of a connection on a given port.

Exceptions
uhd::value_errorif this_port is not connected.

◆ get_upstream_port()

size_t uhd::rfnoc::node_ctrl_base::get_upstream_port ( const size_t  this_port)

Return the remote port of a connection on a given port.

Exceptions
uhd::value_errorif this_port is not connected.

◆ list_downstream_nodes()

node_map_t uhd::rfnoc::node_ctrl_base::list_downstream_nodes ( )
inline

◆ list_upstream_nodes()

node_map_t uhd::rfnoc::node_ctrl_base::list_upstream_nodes ( )
inline

◆ set_downstream_port()

void uhd::rfnoc::node_ctrl_base::set_downstream_port ( const size_t  this_port,
const size_t  remote_port 
)

For an existing connection, store the remote port number.

Exceptions
uhd::value_errorif this_port is not connected.

◆ set_upstream_port()

void uhd::rfnoc::node_ctrl_base::set_upstream_port ( const size_t  this_port,
const size_t  remote_port 
)

For an existing connection, store the remote port number.

Exceptions
uhd::value_errorif this_port is not connected.

◆ unique_id()

virtual std::string uhd::rfnoc::node_ctrl_base::unique_id ( ) const
virtual

Returns a unique string that identifies this block.

Reimplemented in uhd::rfnoc::block_ctrl_base.

◆ update_graph()

void uhd::rfnoc::node_ctrl_base::update_graph ( )
inlineprotected

Initiate the update graph callback

Call this from your block when you've changed one of these:

  • sampling rate
  • scaling
  • tick rate

Friends And Related Function Documentation

◆ uhd::usrp::device3_impl

friend class uhd::usrp::device3_impl
friend

Member Data Documentation

◆ _args

uhd::device_addr_t uhd::rfnoc::node_ctrl_base::_args
protected

Stores default arguments.

◆ _downstream_nodes

node_map_t uhd::rfnoc::node_ctrl_base::_downstream_nodes
protected

List of downstream nodes.

◆ _num_input_ports

size_t uhd::rfnoc::node_ctrl_base::_num_input_ports
protected

Number of input ports

◆ _num_output_ports

size_t uhd::rfnoc::node_ctrl_base::_num_output_ports
protected

Number of output ports

◆ _rx_streamer_active

std::map<size_t, bool> uhd::rfnoc::node_ctrl_base::_rx_streamer_active
protected

For every output port, store rx streamer activity.

If _rx_streamer_active[0] == true, this means that an active rx streamer is operating on port 0. If it is false, or if the entry does not exist, there is no streamer. Values are toggled by set_rx_streamer().

◆ _tx_streamer_active

std::map<size_t, bool> uhd::rfnoc::node_ctrl_base::_tx_streamer_active
protected

For every input port, store tx streamer activity.

If _tx_streamer_active[0] == true, this means that an active tx streamer is operating on port 0. If it is false, or if the entry does not exist, there is no streamer. Values are toggled by set_tx_streamer().

◆ _upstream_nodes

node_map_t uhd::rfnoc::node_ctrl_base::_upstream_nodes
protected

List of upstream nodes.


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