template<class T>
class Rose::Tree::List< T >
Tree vertex that points to an ordered sequence of indexable children.
This vertex acts like an std::vector
except that inserting and erasing children also adjusts the child's parent pointer.
Definition at line 12 of file List.h.
|
bool | empty () const |
| Test whether vector is empty. More...
|
|
size_t | size () const |
| Number of child edges. More...
|
|
void | reserve (size_t n) |
| Reserve space so the child edge vector can grow without being reallocated. More...
|
|
size_t | capacity () const |
| Reserved capacity. More...
|
|
Edge< T > & | push_back (const std::shared_ptr< T > &elmt) |
| Insert a child pointer at the end of this node. More...
|
|
BasePtr | pop_back () |
| Erase a child edge from the end of this node. More...
|
|
iterator | begin () |
| Return an iterator pointing to the first edge. More...
|
|
iterator | end () |
| Return an iterator pointing to one past the last edge. More...
|
|
Edge< T > & | front () |
| Return a reference to the first edge. More...
|
|
Edge< T > & | back () |
| Return a reference to the last edge. More...
|
|
|
const Edge< T > & | operator[] (size_t i) const |
| Return a reference to the Ith edge.
|
|
Edge< T > & | operator[] (size_t i) |
| Return a reference to the Ith edge.
|
|
const Edge< T > & | at (size_t i) const |
| Return a reference to the Ith edge.
|
|
Edge< T > & | at (size_t i) |
| Return a reference to the Ith edge.
|
|
Ptr | pointer () |
| Returns a shared pointer to this vertex. More...
|
|
template<class Visitor > |
auto | traverseReverse (const Visitor &visitor) |
| Traverse in reverse direction from children to parents. More...
|
|
template<class Visitor > |
auto | traverse (const Visitor &visitor) |
| Traverse in forward direction from parents to children. More...
|
|
template<class T > |
std::shared_ptr< T > | findAncestor () |
| Traversal that finds an ancestor of a particular type. More...
|
|
template<class T > |
std::vector< std::shared_ptr< T > > | findDescendants () |
| Traversal that finds all the descendants of a particular type. More...
|
|
std::string | childName (size_t i) |
| Returns the property name for a child. More...
|
|
Ptr | child (size_t i) |
| Returns the pointer for a child. More...
|
|
size_t | nChildren (size_t i) |
| Returns the number of children. More...
|
|
template<class T >
|
inlineoverrideprotectedvirtual |
Finds information about an indexed child.
The index, i
, specifies the child about which information is returned. Children are numbered recursively in base classes followed by the current class. This function is re-implemented in every derived class that has children.
A ChildDescriptor is returned for every query. If the index is out of range for the class, then the return value is for a child one past the end. I.e., the index is equal to the number of children, the name is empty, and the value is a null pointer.
Reimplemented from Rose::Tree::Base.
Definition at line 255 of file List.h.