16 #ifndef BORNAGAIN_PARAM_NODE_INODE_H
17 #define BORNAGAIN_PARAM_NODE_INODE_H
25 const double INF = std::numeric_limits<double>::infinity();
52 INode(
const NodeMeta& meta,
const std::vector<double>& PValues);
65 virtual std::vector<const INode*>
getChildren()
const;
67 std::vector<const INode*>
progeny()
const;
89 std::vector<double>
m_P;
93 std::vector<const INode*>&
operator<<(std::vector<const INode*>& v_node,
94 const std::unique_ptr<T>& node)
97 v_node.push_back(node.get());
102 std::vector<const INode*>&
operator<<(std::vector<const INode*>&& v_node,
103 const std::unique_ptr<T>& node)
106 v_node.push_back(node.get());
110 inline std::vector<const INode*>&
operator<<(std::vector<const INode*>& v_node,
const INode* node)
112 v_node.push_back(node);
116 inline std::vector<const INode*>&
operator<<(std::vector<const INode*>&& v_node,
const INode* node)
118 v_node.push_back(node);
122 inline std::vector<const INode*>&
operator<<(std::vector<const INode*>& v_node,
123 const std::vector<const INode*>& other)
125 v_node.insert(v_node.end(), other.begin(), other.end());
129 inline std::vector<const INode*>&
operator<<(std::vector<const INode*>&& v_node,
130 const std::vector<const INode*>& other)
132 v_node.insert(v_node.end(), other.begin(), other.end());
Defines interface class INodeVisitor.
NodeMeta nodeMetaUnion(const std::vector< ParaMeta > &base, const NodeMeta &other)
Defines interface IParametricComponent.
std::ostream & operator<<(std::ostream &os, const BasicVector3D< T > &a)
Output to stream.
Visitor interface to visit ISampleNode objects.
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.
virtual void accept(INodeVisitor *visitor) const =0
Calls the INodeVisitor's visit method.
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.
Manages a local parameter pool, and a tree of child pools.
Container with parameters for IParametricComponent object.