int VarTree::getIndex( const Iterator& item ) { int index = 0; Iterator it; for( it = m_flat ? firstLeaf() : m_children.begin(); it != m_children.end(); it = m_flat ? getNextLeaf( it ) : getNextVisibleItem( it ) ) { if( it == item ) break; index++; } return (it == item) ? index : -1; }
// iterating all nodes inline Ref<Node> first() const { return firstLeaf(); }
/// Beginning of the children's list IteratorVisible begin() { return IteratorVisible( m_flat ? firstLeaf() : m_children.begin(), this ); }