Loading...
Searching...
No Matches
uhd::experts::expert_factory Class Reference

`#include <uhd/experts/expert_factory.hpp>`

Inheritance diagram for uhd::experts::expert_factory:
[legend]
Collaboration diagram for uhd::experts::expert_factory:
[legend]

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

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 )

inline static

Add a data node to the expert graph.

Parameters

  container | A shared pointer to the container to add the node to
  name | The name of the data node
  init_val | The initial value of the data node
  mode | The 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>

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 )

inline static

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

  container | A shared pointer to the expert container to add the node to
  subtree | A shared pointer to subtree to add the property to
  path | The path of the property in the subtree
  init_val | The initial value of both the data nodes
  mode | The auto resolve mode

## add_dual_prop_node() [2/2]

template<typename data_t>

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 )

inline static

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

Parameters

  container | A shared pointer to the expert container to add the node to
  subtree | A shared pointer to subtree to add the property to
  path | The path of the property in the subtree
  desired_name | The name of the desired data node in the expert graph
  coerced_name | The name of the coerced data node in the expert graph
  init_val | The initial value of both the data nodes
  mode | The 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() [1/2]

template<typename data_t>

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 )

inline static

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

  container | A shared pointer to the expert container to add the node to
  subtree | A shared pointer to subtree to add the property to
  path | The path of the property in the subtree
  init_val | The initial value of the data node
  mode | The auto resolve mode

## add_prop_node() [2/2]

template<typename data_t>

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 )

inline static

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

  container | A shared pointer to the expert container to add the node to
  subtree | A shared pointer to subtree to add the property to
  path | The path of the property in the subtree
  name | The name of the data node in the expert graph
  init_val | The initial value of the data node
  mode | The 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_worker_node() [1/2]

template<typename worker_t>

void uhd::experts::expert_factory::add_worker_node | ( | expert_container::sptr | container | ) |

inline static

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

Template Parameters

  worker_t | Data type of the worker class

Parameters

  container | A shared pointer to the container to add the node to

## add_worker_node() [2/2]

template<typename worker_t, typename... Args>

void uhd::experts::expert_factory::add_worker_node | ( | expert_container::sptr | container,
|  | Args const &... | args )

inline static

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

Template Parameters

  worker_t | Data type of the worker class
  arg1_t | Data type of the first argument to the constructor
  ... |
  argN_t | Data type of the Nth argument to the constructor

Parameters

  container | A shared pointer to the container to add the node to
  args | arguments to the ctor
  ... |

## create_container()

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

  name | Name of the container

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

- expert_factory.hpp