USRP Hardware Driver and USRP Manual  Version: 004.000.000.HEAD-0-g8773fb2c
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
 

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 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 ()
 
template<typename T >
UHD_INLINE std::vector< boost::shared_ptr< T > > find_upstream_node ()
 
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)
 

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

Member Typedef Documentation

◆ node_map_pair_t

typedef std::pair< size_t, wptr > uhd::rfnoc::node_ctrl_base::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.

◆ find_downstream_node()

template<typename T >
UHD_INLINE std::vector< boost::shared_ptr<T> > uhd::rfnoc::node_ctrl_base::find_downstream_node ( )
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 ( )
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.

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.

◆ _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: