#include <uhd/rfnoc/sink_node_ctrl.hpp>
Public Types | |
typedef boost::shared_ptr < sink_node_ctrl > | sptr |
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 |
![]() | |
typedef boost::shared_ptr < node_ctrl_base > | sptr |
typedef boost::weak_ptr < node_ctrl_base > | wptr |
typedef std::map< size_t, wptr > | node_map_t |
typedef std::pair< size_t, wptr > | node_map_pair_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) |
![]() | |
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 | |
virtual size_t | _request_input_port (const size_t suggested_port, const uhd::device_addr_t &args) const |
![]() | |
node_ctrl_base (void) | |
virtual | ~node_ctrl_base () |
virtual void | _register_downstream_node (node_ctrl_base::sptr downstream_node, size_t port) |
Protected Attributes | |
std::map< size_t, bool > | _tx_streamer_active |
![]() | |
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... | |
typedef std::pair< size_t, boost::weak_ptr<sink_node_ctrl> > uhd::rfnoc::sink_node_ctrl::node_map_pair_t |
typedef std::map< size_t, boost::weak_ptr<sink_node_ctrl> > uhd::rfnoc::sink_node_ctrl::node_map_t |
typedef boost::shared_ptr<sink_node_ctrl> uhd::rfnoc::sink_node_ctrl::sptr |
|
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:
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.
suggested_port | Try and connect here. |
args | When deciding on a port number, these arguments may be used. |
Reimplemented in uhd::rfnoc::sink_block_ctrl_base.
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.
|
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.
|
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().