composite_pattern::Component

class Component

The Component interface declares common operations for both simple and complex objects.

Subclassed by composite_pattern::Composite, composite_pattern::Leaf

Public Functions

virtual void operation() const = 0

Performs the operation for the component.

inline virtual void add(std::shared_ptr<Component>)

Adds a child component (only meaningful for Composite).

inline virtual void remove(std::shared_ptr<Component>)

Removes a child component (only meaningful for Composite).

inline virtual bool isComposite() const

Checks if the component is a composite.

Returns:

True if composite, otherwise false.