|
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) |
|
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.
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 (==)