iterator_pattern::ConcreteAggregate

template<typename T>
class ConcreteAggregate : public iterator_pattern::Aggregate<T>

Concrete Aggregate that holds a collection of items.

Implements the Aggregate interface and provides a method to create iterators.

Public Functions

inline void addItem(const T &item)

Add an item to the collection.

Parameters:

item – The item to add.

inline virtual std::unique_ptr<Iterator<T>> createIterator() const override

Retrieve the collection’s iterator.

Returns:

A unique pointer to a ConcreteIterator.