30 m_NP(meta.paraMeta.size())
35 for (
size_t i = 0; i <
m_NP; ++i) {
70 std::vector<const INode*> result;
71 result.push_back(
this);
73 for (
const auto* p : child->progeny())
96 if (node->
parent() !=
this)
99 int result(-1), count(0);
102 if (child ==
nullptr)
103 throw std::runtime_error(
"INode::copyNumber() -> Error. Nullptr as child.");
108 if (child->getName() == node->
getName())
112 return count > 1 ? result : -1;
117 std::string result =
getName();
121 result = result + std::to_string(index);
132 child->parameterPool()->copyToExternalPool(path, result.get());
135 return result.release();
Defines and implements namespace algo with some algorithms.
#define ASSERT(condition)
NodeMeta nodeMetaUnion(const std::vector< ParaMeta > &base, const NodeMeta &other)
Defines collection of utility functions for INode.
Defines class ParameterPool.
Defines class RealParameter.
Base class for tree-like structures containing parameterized objects.
virtual std::string treeToString() const
Returns multiline string representing tree structure below the node.
std::string displayName() const
Returns display name, composed from the name of node and it's copy number.
virtual void setParent(const INode *newParent)
std::vector< const INode * > progeny() const
Returns a vector of all descendants.
const INode * parent() const
virtual std::vector< const INode * > getChildren() const
Returns a vector of children.
ParameterPool * createParameterTree() const
Creates new parameter pool, with all local parameters and those of its children.
std::vector< double > m_P
void registerChild(INode *node)
int copyNumber(const INode *node) const
Returns copyNumber of child, which takes into account existence of children with same name.
const std::string & getName() const
ParameterPool * parameterPool() const
Returns pointer to the parameter pool.
void setName(const std::string &name)
RealParameter & registerParameter(const std::string &name, double *parpointer)
Container with parameters for IParametricComponent object.
void clear()
Clears the parameter map.
std::string nodeToString(const INode *node)
Returns multiline string representing tree structure starting from given node.
std::string nodePath(const INode *node, const INode *root=nullptr)
Returns path composed of node's displayName, with respect to root node.
std::vector< T > concat(const std::vector< T > &v1, const std::vector< T > &v2)
Returns the concatenation of two std::vectors.