Go to the documentation of this file.
26 #ifndef __TERRALIB_COMMON_INTERNAL_COUNTEDTREEITEM_H
27 #define __TERRALIB_COMMON_INTERNAL_COUNTEDTREEITEM_H
37 #include <boost/intrusive_ptr.hpp>
66 typedef std::list<TreeItemPtr>::iterator
iterator;
176 std::list<TreeItemPtr>
remove(std::size_t i, std::size_t count);
296 #endif // __TERRALIB_COMMON_INTERNAL_COUNTEDTREEITEM_H
const_iterator begin() const
It returns the constant iterator associated to the first child of this item.
This abstract class describes a basic item to be organized in a tree-oriented way.
void getDescendantsCount(std::size_t &count) const
It returns the number of nodes that descends from this node.
void insert(std::size_t i, const TreeItemPtr &childItem)
It inserts an item in the informed position.
TreeItem * getParent() const
It returns a pointer to the parent of this node.
void setParent(TreeItem *parent)
It sets the parent of this item to the specified one. Don't use this method if you are not sure how t...
#define TECOMMONEXPORT
You can use this macro in order to export/import classes and functions from this module.
const TreeItemPtr & operator[](std::size_t i) const
It returns the n-th child.
std::list< TreeItemPtr >::const_iterator const_iterator
iterator begin()
It returns the iterator associated to the first child of this item.
TreeItemPtr remove(std::size_t i)
It removes the i-th child.
TreeItem(TreeItem *parent=0)
It initializes a new item having a parent.
std::list< TreeItemPtr >::iterator iterator
const TreeItemPtr & getChild(std::size_t i) const
It returns the n-th child.
boost::intrusive_ptr< TreeItem > TreeItemPtr
void swap(const TreeItemPtr &firstChild, const TreeItemPtr &secondChild)
It swaps the position of the given children.
const std::list< TreeItemPtr > & getChildren() const
It returns the children of this tree item.
std::list< TreeItemPtr > remove(std::size_t i, std::size_t count)
It removes from the given position a certain number of items as children of this item....
iterator end()
It returns the iterator that refers to one past the children of this item.
void add(const TreeItemPtr &childItem)
It adds (appends) the item to the end of the children's list.
TreeItem * m_parent
A pointer to the parent node.
bool hasChildren() const
It returns true if the item has descendants.
TreeItemPtr replace(std::size_t i, const TreeItemPtr &childItem)
It replaces the child item at the given position by the new one. The replaced item will be disconnect...
void disconnect()
It disconnects this item from its parent, if it has one.
const_iterator end() const
It returns the constant iterator that refers to one past the end of the children of this item.
std::size_t getChildrenCount() const
It returns the number of children of this node.
void swap(const TreeItemPtr &sibling)
It swaps this item with its sibling in their parent node.
static const std::size_t npos
A value to indicate no match.
TreeItem(const TreeItemPtr &parent)
It initializes a new item having a parent.
virtual ~TreeItem()
Virtual destructor.
std::size_t getIndex() const
It returns the index of this item in the list of children of its parent item.
Proxy configuration file for TerraView (see terraview_config.h).
A counted class keeps track of how many abstract instances are pointing to it.
A counted class keeps track of how many abstract instances are pointing to it.
bool isSibling(const TreeItem *item) const
It checks if the given layer is sibling of this one.
std::list< TreeItemPtr > m_children
Pointers to the items that are children.