A C++ template library for embedded applications
Designed and maintained by
Aster Consulting Ltd

Visitor

A set of template classes to enable the easy creation of objects using the Visitor pattern.
The purpose of these classes is to create a base classes with pure virtual functions for each supplied type.
Any derived class that tries to instantiate an object from it will then be forced to supply an overridden version for each
and every function. See the tutorial.

There are two templated classes:-

visitable

The visitable base class.
Classes derived from this are visitable by the types declared in the template parameter list. Up to four visitor types may
be specified. A pure virtual accept function will be created for each visitor type.

template <typename T1, typename T2 = void, typename T3 = void, typename T4 = void>
class visitable

visitor

The visitor base class.
Classes derived from this can be passed to objects derived from visitable. Up to sixteen types may be specified in the
template parameter list. A pure virtual visit function will be created for each specified type.

template <typename T1,         typename T2  = void, typename T3  = void, typename T4  = void,
          typename T5  = void, typename T6  = void, typename T7  = void, typename T8  = void,
          typename T9  = void, typename T10 = void, typename T11 = void, typename T12 = void,
          typename T13 = void, typename T14 = void, typename T15 = void, typename T16 = void>
class visitor
visitor.h