USRP Hardware Driver and USRP Manual  Version: 4.7.0.0
UHD and USRP Manual
uhd::experts::expert_factory Class Reference

#include <uhd/experts/expert_factory.hpp>

Inheritance diagram for uhd::experts::expert_factory:

Static Public Member Functions

static expert_container::sptr create_container (const std::string &name)
 
template<typename data_t >
static void add_data_node (expert_container::sptr container, const std::string &name, const data_t &init_val, const auto_resolve_mode_t mode=AUTO_RESOLVE_OFF)
 
template<typename data_t >
static property< data_t > & add_prop_node (expert_container::sptr container, property_tree::sptr subtree, const fs_path &path, const std::string &name, const data_t &init_val, const auto_resolve_mode_t mode=AUTO_RESOLVE_OFF)
 
template<typename data_t >
static property< data_t > & add_prop_node (expert_container::sptr container, property_tree::sptr subtree, const fs_path &path, const data_t &init_val, const auto_resolve_mode_t mode=AUTO_RESOLVE_OFF)
 
template<typename data_t >
static property< data_t > & add_dual_prop_node (expert_container::sptr container, property_tree::sptr subtree, const fs_path &path, const std::string &desired_name, const std::string &coerced_name, const data_t &init_val, const auto_resolve_mode_t mode=AUTO_RESOLVE_OFF)
 
template<typename data_t >
static property< data_t > & add_dual_prop_node (expert_container::sptr container, property_tree::sptr subtree, const fs_path &path, const data_t &init_val, const auto_resolve_mode_t mode=AUTO_RESOLVE_OFF)
 
template<typename worker_t >
static void add_worker_node (expert_container::sptr container)
 
template<typename worker_t , typename... Args>
static void add_worker_node (expert_container::sptr container, Args const &... args)
 

Detailed Description

expert_factory is a friend of expert_container and handles all operations to create and change the structure of the an expert container. The expert_factory allocates storage for the nodes in the expert_container and passes allocated objects to the container using private APIs. The expert_container instance owns all data and workernodes and is responsible for releasing their storage on destruction.

Member Function Documentation

◆ add_data_node()

template<typename data_t >
static void uhd::experts::expert_factory::add_data_node ( expert_container::sptr  container,
const std::string &  name,
const data_t &  init_val,
const auto_resolve_mode_t  mode = AUTO_RESOLVE_OFF 
)
inlinestatic

Add a data node to the expert graph.

Parameters
containerA shared pointer to the container to add the node to
nameThe name of the data node
init_valThe initial value of the data node
modeThe auto resolve mode

Requirements for data_t

  • Must have a default constructor
  • Must have a copy constructor
  • Must have an assignment operator (=)
  • Must have an equality operator (==)

◆ add_dual_prop_node() [1/2]

template<typename data_t >
static property<data_t>& uhd::experts::expert_factory::add_dual_prop_node ( expert_container::sptr  container,
property_tree::sptr  subtree,
const fs_path path,
const std::string &  desired_name,
const std::string &  coerced_name,
const data_t &  init_val,
const auto_resolve_mode_t  mode = AUTO_RESOLVE_OFF 
)
inlinestatic

Add a dual expert property to a property tree AND an expert graph. A dual property is a desired and coerced value pair

Parameters
containerA shared pointer to the expert container to add the node to
subtreeA shared pointer to subtree to add the property to
pathThe path of the property in the subtree
desired_nameThe name of the desired data node in the expert graph
coerced_nameThe name of the coerced data node in the expert graph
init_valThe initial value of both the data nodes
modeThe auto resolve mode

Requirements for data_t

  • Must have a default constructor
  • Must have a copy constructor
  • Must have an assignment operator (=)
  • Must have an equality operator (==)

◆ add_dual_prop_node() [2/2]

template<typename data_t >
static property<data_t>& uhd::experts::expert_factory::add_dual_prop_node ( expert_container::sptr  container,
property_tree::sptr  subtree,
const fs_path path,
const data_t &  init_val,
const auto_resolve_mode_t  mode = AUTO_RESOLVE_OFF 
)
inlinestatic

Add a dual expert property to a property tree AND an expert graph. A dual property is a desired and coerced value pair The property is registered with path/desired as the desired node name and path/coerced as the coerced node name

Parameters
containerA shared pointer to the expert container to add the node to
subtreeA shared pointer to subtree to add the property to
pathThe path of the property in the subtree
init_valThe initial value of both the data nodes
modeThe auto resolve mode

◆ add_prop_node() [1/2]

template<typename data_t >
static property<data_t>& uhd::experts::expert_factory::add_prop_node ( expert_container::sptr  container,
property_tree::sptr  subtree,
const fs_path path,
const std::string &  name,
const data_t &  init_val,
const auto_resolve_mode_t  mode = AUTO_RESOLVE_OFF 
)
inlinestatic

Add a expert property to a property tree AND an expert graph

The underlying property can be used like any other property tree property, including setting a coercer through set_coercer(). However, this means that the coercion is happening outside of the expert framework. This is primarily useful for tiny coercions (e.g., we accept both upper and lower case values, but only want lower case downstream) for which we don't want to bother with a full expert, or for which we don't want to trigger resolution at all (if mode is set to AUTO_RESOLVE_OFF). For more full-fledged coercion, prefer add_dual_prop_node(). This will properly engage the expert graph.

Parameters
containerA shared pointer to the expert container to add the node to
subtreeA shared pointer to subtree to add the property to
pathThe path of the property in the subtree
nameThe name of the data node in the expert graph
init_valThe initial value of the data node
modeThe auto resolve mode

Requirements for data_t

  • Must have a default constructor
  • Must have a copy constructor
  • Must have an assignment operator (=)
  • Must have an equality operator (==)

◆ add_prop_node() [2/2]

template<typename data_t >
static property<data_t>& uhd::experts::expert_factory::add_prop_node ( expert_container::sptr  container,
property_tree::sptr  subtree,
const fs_path path,
const data_t &  init_val,
const auto_resolve_mode_t  mode = AUTO_RESOLVE_OFF 
)
inlinestatic

Add a expert property to a property tree AND an expert graph. The property is registered with the path as the identifier for both the property subtree and the expert container

Parameters
containerA shared pointer to the expert container to add the node to
subtreeA shared pointer to subtree to add the property to
pathThe path of the property in the subtree
init_valThe initial value of the data node
modeThe auto resolve mode

◆ add_worker_node() [1/2]

template<typename worker_t >
static void uhd::experts::expert_factory::add_worker_node ( expert_container::sptr  container)
inlinestatic

Add a worker node to the expert graph. The expert_container owns and manages storage for the worker

Template Parameters
worker_tData type of the worker class
Parameters
containerA shared pointer to the container to add the node to

◆ add_worker_node() [2/2]

template<typename worker_t , typename... Args>
static void uhd::experts::expert_factory::add_worker_node ( expert_container::sptr  container,
Args const &...  args 
)
inlinestatic

Add a worker node to the expert graph. The expert_container owns and manages storage for the worker

Template Parameters
worker_tData type of the worker class
arg1_tData type of the first argument to the constructor
...
argN_tData type of the Nth argument to the constructor
Parameters
containerA shared pointer to the container to add the node to
argsarguments to the ctor
...

◆ create_container()

static expert_container::sptr uhd::experts::expert_factory::create_container ( const std::string &  name)
static

Creates an empty instance of expert_container with the specified name.

Parameters
nameName of the container

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