TreeItemData is some (arbitrary) user class associated with some item. The
main advantage of having this class is that TreeItemData objects are
destroyed automatically by the tree and, as this class has virtual destructor,
it means that the memory and any other resources associated with a tree item
will be automatically freed when it is deleted. Note that we don’t use Object
as the base class for TreeItemData because the size of this class is
critical: in many applications, each tree leaf will have TreeItemData
associated with it and the number of leaves may be quite big.
Also please note that because the objects of this class are deleted by the tree
using the operator delete
, they must always be allocated on the heap
using new
.
Virtual destructor.
Returns the item associated with this node.
Sets the item associated with this node.
[This page automatically generated from the Textile source at 2023-06-13 21:31:31 +0000]