30 std::string s_indent(
int depth)
32 const int multiplier = 4;
33 return std::string(multiplier * depth,
'.');
37 std::string poolToString(
const INode& node)
39 std::ostringstream result;
47 for (
auto par : pars) {
48 result <<
"'" << par->getName() <<
"':" << par->value();
50 if (index != pars.size())
59 std::string nodeString(
const INode& node,
int depth)
61 std::ostringstream result;
62 result << s_indent(depth) << node.
displayName() << poolToString(node) <<
"\n";
69 std::ostringstream result;
73 while (!it.isDone()) {
74 const INode* child = it.getCurrent();
75 result << nodeString(*child, it.depth() - 1);
84 std::vector<std::string> pathElements;
85 const INode* current = &node;
86 while (current && current != root) {
88 pathElements.push_back(
"/");
89 current = current->parent();
92 if (root !=
nullptr && current != root) {
94 "belong to root's branch");
97 std::reverse(pathElements.begin(), pathElements.end());
98 std::ostringstream result;
99 std::copy(pathElements.begin(), pathElements.end(), std::ostream_iterator<std::string>(result));
Defines many exception classes in namespace Exceptionss.
Defines class IterationStrategy and children.
Defines classes IteratorState, IteratorMemento and NodeIterator.
Defines collection of utility functions for INode.
std::string nodePath(const INode &node, const INode *root=nullptr)
Returns path composed of node's displayName, with respect to root node.
std::string nodeToString(const INode &node)
Returns multiline string representing tree structure starting from given node.
Defines class ParameterPool.
Defines class RealParameter.
Base class for tree-like structures containing parameterized objects.
std::string displayName() const
Returns display name, composed from the name of node and it's copy number.
ParameterPool * parameterPool() const
Returns pointer to the parameter pool.
Iterator through INode tree of objects.
const std::vector< RealParameter * > parameters() const
Returns full vector of parameters.