CComposite Class

class CComposite

Implements the composite design pattern

Defined in: Composite.h

Class Template Arguments

_Component

Type of the elements in the composite structure

guid

GUID that identifies the Composite interface among all the interfaces implemented by an element

Class Members

SEC_INT GetChildrenCount() const

Returns the number of nodes directly contained in this node

SEC_INT GetAllDescendantsCount() const

Returns the total number of nodes contained by this node and its children

typename _Component* GetParent() const

Returns this node's parent

void SetParent(typename _Component* pComp)

Sets the parent node

typename _Component* GetRoot()

Returns the root of the composite tree

SEC_INT AddChild(typename _Component* pComp)

Adds a node as a child of this node

SEC_INT RemoveChild(typename _Component* pComp)

Removes a child node

typename Iterator* GetChildIterator()

Returns an iterator of this node's children