Design Overview

Slot Call Iterator

The slot call iterator is conceptually a stack of iterator adaptors that modify the behavior of the underlying iterator through the list of slots. The following table describes the type and behavior of each iterator adaptor required. Note that this is only a conceptual model: the implementation collapses all these layers into a single iterator adaptor because several popular compilers failed to compile the implementation of the conceptual model.

Iterator Adaptor Purpose

Slot List Iterator

An iterator through the list of slots connected to a signal. The value_type of this iterator will be std::pair<any, connection>, where the any contains an instance of the slot function type.

Filter Iterator Adaptor

This filtering iterator adaptor filters out slots that have been disconnected, so we never see a disconnected slot in later stages.

Projection Iterator Adaptor

The projection iterator adaptor returns a reference to the first member of the pair that constitutes a connected slot (e.g., just the boost::any object that holds the slot function).

Transform Iterator Adaptor

This transform iterator adaptor performs an any_cast to extract a reference to the slot function with the appropriate slot function type.

Transform Iterator Adaptor

This transform iterator adaptor calls the function object returned by dereferencing the underlying iterator with the set of arguments given to the signal itself, and returns the result of that slot call.

Input Caching Iterator Adaptor

This iterator adaptor caches the result of dereferencing the underlying iterator. Therefore, dereferencing this iterator multiple times will only result in the underlying iterator being dereferenced once; thus, a slot can only be called once but its result can be used multiple times.

Slot Call Iterator

Iterates over calls to each slot.