Description
Reads configuration tree and sets up the logger.
Parameters
config
- configuration tree from config file
level
- default level of the logger
name
- name of the module (e.g. global, test, decl_hdf5)
Result
void
each (
std::function< void(PC_tree_t)> operation, PC_tree_t tree )
Description
Iterates and apply the provided function to all elements of a PC list.
Parameters
operation
- the operation to apply to each element of the tree
tree
- the tree containing the list
void
each (
std::function< void(PC_tree_t, PC_tree_t)> operation, PC_tree_t tree )
Description
Iterates and apply the provided function to all elements of a PC mapping.
Parameters
operation
- the operation to apply to each element of the tree
tree
- the tree containing the mapping
void
each_in_omap (
std::function< void(PC_tree_t, PC_tree_t)> operation, PC_tree_t tree )
Description
Iterates and apply the provided function to all elements of a PC ordered mapping.
Parameters
operation
- the operation to apply to each element of the tree
tree
- the tree containing the ordered mapping
bool
is_list (
PC_tree_t tree )
Description
Checks if the tree is a list.
Parameters
tree
- the node
Result
true if tree is a list, false otherwise
bool
is_map (
PC_tree_t tree )
Description
Checks if the tree is a map.
Parameters
tree
- the node
Result
true if tree is a map, false otherwise
bool
is_scalar (
PC_tree_t tree )
Description
Checks if the tree is a scalar.
Parameters
tree
- the node
Result
true if tree is a scalar, false otherwise
int
len (
PC_tree_t tree )
Description
Returns the length of a node.
- for a sequence: the number of nodes,
- for a mapping: the number of pairs,
- for a scalar: the string length.
throws an Error if the provided tree is in error
Parameters
tree
- the sequence or mapping
Result
int
len (
int dflt, PC_tree_t tree )
Description
Returns the length of a node.
- for a sequence: the number of nodes,
- for a mapping: the number of pairs,
- for a scalar: the string length.
returns the default value in case of error
Parameters
dflt
- the default value in case of error
tree
- the sequence or mapping
Result
void
opt_each (
std::function< void(PC_tree_t)> operation, PC_tree_t tree )
Description
Iterates and apply the provided function to all elements of a PC list or directly to the provided element if it is not a list.
Parameters
operation
- the operation to apply to the elements
tree
- the tree containing the list or the single element
unsigned long
plugin_api_version (
unsigned long expected_version
= 0 )
Description
Checks compatibility with a plugin API.
Parameters
expected_version
- the expected version of the API or 0 for no check
Result
the version of the API provided by PDI
bool
to_bool (
PC_tree_t tree )
Description
Returns the boolean value of a scalar node.
throws an Error if the provided tree is in error
Parameters
tree
- the node
Result
the boolean value of the scalar node
bool
to_bool (
bool dflt, PC_tree_t tree )
Description
Returns the boolean value of a scalar node.
returns the default value in case of error
Parameters
dflt
- the default value in case of error
tree
- the node
Result
the boolean value of the scalar node
double
to_double (
PC_tree_t tree )
Description
Returns the floating point value of a scalar node.
throws an Error if the provided tree is in error
Parameters
tree
- the floating-point-valued node
Result
the floating point value of the scalar node
double
to_double (
double dflt, PC_tree_t tree )
Description
Returns the floating point value of a scalar node.
returns the default value in case of error
Parameters
dflt
- the default value in case of error
tree
- the floating-point-valued node
Result
the floating point value of the scalar node
long
to_long (
PC_tree_t tree )
Description
Returns the int value of a scalar node.
throws an Error if the provided tree is in error
Parameters
tree
- the int-valued node
Result
the int value of the scalar node
long
to_long (
long dflt, PC_tree_t tree )
Description
Returns the int value of a scalar node.
returns the default value in case of error
Parameters
dflt
- the default value in case of error
tree
- the int-valued node
Result
the int value of the scalar node
std::string
to_string (
PC_tree_t tree )
Description
Returns the string content of a scalar node.
throws an Error if the provided tree is in error
Parameters
tree
- the node
Result
the content of the scalar node
std::string
to_string (
const std::string & dflt, PC_tree_t tree )
Description
Returns the string content of a scalar node.
returns the default value in case of error
Parameters
dflt
- the default value in case of error
tree
- the node
Result
the content of the scalar node