ADD: added method to prepend a child
This commit is contained in:
parent
30ccb2e695
commit
22739d8ac4
@ -170,6 +170,14 @@ namespace Tree
|
|||||||
*/
|
*/
|
||||||
void addChild(const std::shared_ptr<Tree::BaseNode> &c) {c->setParent(shared_from_this()); children.push_back(c); }
|
void addChild(const std::shared_ptr<Tree::BaseNode> &c) {c->setParent(shared_from_this()); children.push_back(c); }
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief prepends a child to the node which is already a shared_ptr
|
||||||
|
*
|
||||||
|
* @param c - a shared_ptr to a BaseNode
|
||||||
|
*/
|
||||||
|
void prependChild(const std::shared_ptr<Tree::BaseNode> &c) {c->setParent(shared_from_this()); children.push_front(c); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief adds a container of nodes to the list of children
|
* @brief adds a container of nodes to the list of children
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user