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

#include <uhd/rfnoc/sink_node_ctrl.hpp>

Inheritance diagram for uhd::rfnoc::sink_node_ctrl:
uhd::rfnoc::node_ctrl_base uhd::rfnoc::sink_block_ctrl_base uhd::rfnoc::block_ctrl uhd::rfnoc::ddc_block_ctrl uhd::rfnoc::dma_fifo_block_ctrl uhd::rfnoc::duc_block_ctrl uhd::rfnoc::fir_block_ctrl uhd::rfnoc::null_block_ctrl uhd::rfnoc::radio_ctrl uhd::rfnoc::replay_block_ctrl uhd::rfnoc::siggen_block_ctrl uhd::rfnoc::window_block_ctrl

Public Types

typedef boost::shared_ptr< sink_node_ctrlsptr
 
typedef std::map< size_t, boost::weak_ptr< sink_node_ctrl > > node_map_t
 
typedef std::pair< size_t, boost::weak_ptr< sink_node_ctrl > > node_map_pair_t
 
- Public Types inherited from uhd::rfnoc::node_ctrl_base
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

size_t connect_upstream (node_ctrl_base::sptr upstream_node, size_t port=ANY_PORT, const uhd::device_addr_t &args=uhd::device_addr_t())
 
virtual void set_tx_streamer (bool active, const size_t port)
 
- Public Member Functions inherited from uhd::rfnoc::node_ctrl_base
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

virtual size_t _request_input_port (const size_t suggested_port, const uhd::device_addr_t &args) const
 
- Protected Member Functions inherited from uhd::rfnoc::node_ctrl_base
 node_ctrl_base (void)
 
virtual ~node_ctrl_base ()
 
virtual void _register_downstream_node (node_ctrl_base::sptr downstream_node, size_t port)
 
void update_graph ()
 

Additional Inherited Members

- Protected Attributes inherited from uhd::rfnoc::node_ctrl_base
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
 

Member Typedef Documentation

◆ node_map_pair_t

typedef std::pair<size_t, boost::weak_ptr<sink_node_ctrl> > uhd::rfnoc::sink_node_ctrl::node_map_pair_t

◆ node_map_t

typedef std::map<size_t, boost::weak_ptr<sink_node_ctrl> > uhd::rfnoc::sink_node_ctrl::node_map_t

◆ sptr

Member Function Documentation

◆ _request_input_port()

virtual size_t uhd::rfnoc::sink_node_ctrl::_request_input_port ( const size_t  suggested_port,
const uhd::device_addr_t args 
) const
protectedvirtual

Ask for a port number to connect an upstream block to.

Typically, this will be overridden for custom behaviour. The default is to return the suggested port, disregarding args, unless port == ANY_PORT, in which case the first unused input port is returned.

When deriving this function for custom behaviour, consider:

  • The result is used to call register_upstream_node(), which has its own checks in place.
  • This function may throw if the arguments can't be resolved. The exception will propagate to the user space.
  • Alternatively, the function may return ANY_PORT to signify failure.
  • args and suggested_port should be treated as strong suggestions, but there's no reason to just return any valid port.

Note: For reasons of thread safety, it is recommended to never, ever call this function directly. It will be used by connect_upstream() which will handle the connection process in a thread-safe manner.

Parameters
suggested_portTry and connect here.
argsWhen deciding on a port number, these arguments may be used.
Returns
A valid input port, or ANY_PORT on failure.

Reimplemented in uhd::rfnoc::sink_block_ctrl_base.

◆ connect_upstream()

size_t uhd::rfnoc::sink_node_ctrl::connect_upstream ( node_ctrl_base::sptr  upstream_node,
size_t  port = ANY_PORT,
const uhd::device_addr_t args = uhd::device_addr_t() 
)

Connect another node upstream of this node.

Note: If additional settings are required to make this connection work, e.g. configure flow control, these need to be done separately.

If the requested connection is not possible, this function will throw.

upstream_node Pointer to the node class to connect port Suggested port number on this block to connect the upstream block to. args Any arguments that can be useful for determining the port number.

Returns
The actual port number used.

◆ set_tx_streamer()

virtual void uhd::rfnoc::sink_node_ctrl::set_tx_streamer ( bool  active,
const size_t  port 
)
virtual

Call this function to notify a node about its streamer activity.

When active is set to true, this means this block is now part of an active tx streamer chain. Conversely, when set to false, this means the node has been removed from an tx streamer chain.


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