composite_pattern::Leaf

class Leaf : public composite_pattern::Component

The Leaf class represents the end objects of a composition.

A Leaf cannot have any children. It implements the base Component interface.

Public Functions

inline explicit Leaf(const std::string &name)

Constructs a Leaf with a given name.

Parameters:

name – The name of the leaf.

inline virtual void operation() const override

Performs the operation specific to the Leaf.