From 19ddf0bf31b0e1edd13c55a5518d8c4654da4a37 Mon Sep 17 00:00:00 2001 From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz> Date: Mon, 25 Feb 2019 14:16:27 +0100 Subject: [PATCH] add getChild to VararyNode --- .../src/extensions/container/tree_base.hpp | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/alib2std/src/extensions/container/tree_base.hpp b/alib2std/src/extensions/container/tree_base.hpp index c4ae325cd3..8667f0a8eb 100644 --- a/alib2std/src/extensions/container/tree_base.hpp +++ b/alib2std/src/extensions/container/tree_base.hpp @@ -1058,6 +1058,30 @@ public: child.parent = static_cast < Cast * > ( this ); } + /** + * \brief + * Getter of the child at given index. + * + * \param index the index to retrieve + * + * \return reference to the child at given index + */ + Data & getChild ( int index ) { + return m_children [ index ]; + } + + /** + * \brief + * Getter of the child at given index. + * + * \param index the index to retrieve + * + * \return reference to the child at given index + */ + const Data & getChild ( int index ) const { + return m_children [ index ]; + } + /** * \brief * Setter of the single child of the node. -- GitLab