26 g->remove_all_children();
31 return (
unsigned int)
children.size();
36 std::cerr <<
"group " <<
get_name() <<
":" <<
get_type_name() <<
" -> attempt to access child at " <<
i <<
" what is after last valid location " <<
children.size()-1 << std::endl;
69 std::cerr <<
"attempt to insert child at " <<
i <<
" what is after last valid location " <<
children.size() << std::endl;
group(const std::string &name="")
construct from name
std::vector< base_ptr > children
store a list of children
virtual void insert_child(unsigned int i, base_ptr child)
insert a child at the given position
group_ptr get_group()
cast upward to group
virtual void remove_all_children()
remove all children
void unlink(base_ptr b)
check if the base class is a node and clear the parent of the node
unsigned int get_nr_children() const
return the number of children
std::string get_type_name() const
overload to return the type name of this object
base_ptr get_child(unsigned int i) const
return the i-th child
const_group_ptr get_group_const()
cast upward to const group
void link(base_ptr b)
check if the base class is a node and set the parent of the node
virtual unsigned int remove_child(base_ptr child)
remove all elements of the vector that point to child, return the number of removed children
virtual unsigned int append_child(base_ptr child)
append child and return index of appended child
const std::string & get_name() const
return the parent node
The node class keeps a pointer to its parent.
complete implementation of method actions that only call one method when entering a node
bool empty() const
check if pointer is not yet set
data::ref_ptr< const group, true > const_group_ptr
ref counted pointer to a node
data::ref_ptr< base, true > base_ptr
ref counted pointer to base
data::ref_ptr< node, true > node_ptr
ref counted pointer to a node
data::ref_ptr< group, true > group_ptr
ref counted pointer to a node