Loading...
Searching...
No Matches
visitor
Embedded Template Library. » Patterns

## Classes

class | etl::visitable< T1, T2, T3, T4 >
class | etl::visitable< T1, T2, T3 >
class | etl::visitable< T1, T2 >
class | etl::visitable< T1 >
struct | etl::visitor_tag
class | etl::visitor< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16 >
class | etl::visitor< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15 >
class | etl::visitor< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14 >
class | etl::visitor< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13 >
class | etl::visitor< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12 >
class | etl::visitor< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11 >
class | etl::visitor< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 >
class | etl::visitor< T1, T2, T3, T4, T5, T6, T7, T8, T9 >
class | etl::visitor< T1, T2, T3, T4, T5, T6, T7, T8 >
class | etl::visitor< T1, T2, T3, T4, T5, T6, T7 >
class | etl::visitor< T1, T2, T3, T4, T5, T6 >
class | etl::visitor< T1, T2, T3, T4, T5 >
class | etl::visitor< T1, T2, T3, T4 >
class | etl::visitor< T1, T2, T3 >
class | etl::visitor< T1, T2 >
class | etl::visitor< T1 >
struct | etl::is_visitor< T >

## Detailed Description

A set of template classes for easy implementation of the visitor pattern.
The visitor design pattern is a way of separating an algorithm from an object structure on which it operates. A practical result of this separation is the ability to add new operations to existing object structures without modifying those structures. It is one way to easily follow the open/closed principle. In essence, the visitor allows one to add new virtual functions to a family of classes without modifying the classes themselves; instead, one creates a visitor class that implements all of the appropriate specialisations of the virtual function. The visitor takes the instance as input, and implements the goal through double dispatch.

## Class Documentation

## etl::visitable

class etl::visitable

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

The visitable base class for four visitor types. Derive visitable classes from this.

### Public Member Functions

virtual void | accept (T1 &)=0
virtual void | accept (T2 &)=0
virtual void | accept (T3 &)=0
virtual void | accept (T4 &)=0

## etl::visitable< T1, T2, T3 >

class etl::visitable< T1, T2, T3 >

template<typename T1, typename T2, typename T3>
class etl::visitable< T1, T2, T3 >

The visitable base class for three visitor types. Derive visitable classes from this.

### Public Member Functions

virtual void | accept (T1 &)=0
virtual void | accept (T2 &)=0
virtual void | accept (T3 &)=0

## etl::visitable< T1, T2 >

class etl::visitable< T1, T2 >

template<typename T1, typename T2>
class etl::visitable< T1, T2 >

The visitable base class for two visitor types. Derive visitable classes from this.

### Public Member Functions

virtual void | accept (T1 &)=0
virtual void | accept (T2 &)=0

## etl::visitable< T1 >

class etl::visitable< T1 >

template<typename T1>
class etl::visitable< T1 >

The visitable base class for one visitor type. Derive visitable classes from this.

### Public Member Functions

virtual void | accept (T1 &)=0

## etl::visitor_tag

struct etl::visitor_tag

The tag to identify an etl::visitor.

## etl::visitor

class etl::visitor

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 etl::visitor< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16 >

The visitor base class for sixteen types. Derive visitors from this.

### Public Member Functions

virtual void | visit (T1)=0
virtual void | visit (T2)=0
virtual void | visit (T3)=0
virtual void | visit (T4)=0
virtual void | visit (T5)=0
virtual void | visit (T6)=0
virtual void | visit (T7)=0
virtual void | visit (T8)=0
virtual void | visit (T9)=0
virtual void | visit (T10)=0
virtual void | visit (T11)=0
virtual void | visit (T12)=0
virtual void | visit (T13)=0
virtual void | visit (T14)=0
virtual void | visit (T15)=0
virtual void | visit (T16)=0

## etl::visitor< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15 >

class etl::visitor< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15 >

template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15>
class etl::visitor< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15 >

The visitor base class for fifteen types. Derive visitors from this.

### Public Member Functions

virtual void | visit (T1)=0
virtual void | visit (T2)=0
virtual void | visit (T3)=0
virtual void | visit (T4)=0
virtual void | visit (T5)=0
virtual void | visit (T6)=0
virtual void | visit (T7)=0
virtual void | visit (T8)=0
virtual void | visit (T9)=0
virtual void | visit (T10)=0
virtual void | visit (T11)=0
virtual void | visit (T12)=0
virtual void | visit (T13)=0
virtual void | visit (T14)=0
virtual void | visit (T15)=0

## etl::visitor< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14 >

class etl::visitor< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14 >

template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14>
class etl::visitor< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14 >

The visitor base class for fourteen types. Derive visitors from this.

### Public Member Functions

virtual void | visit (T1)=0
virtual void | visit (T2)=0
virtual void | visit (T3)=0
virtual void | visit (T4)=0
virtual void | visit (T5)=0
virtual void | visit (T6)=0
virtual void | visit (T7)=0
virtual void | visit (T8)=0
virtual void | visit (T9)=0
virtual void | visit (T10)=0
virtual void | visit (T11)=0
virtual void | visit (T12)=0
virtual void | visit (T13)=0
virtual void | visit (T14)=0

## etl::visitor< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13 >

class etl::visitor< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13 >

template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13>
class etl::visitor< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13 >

The visitor base class for thirteen types. Derive visitors from this.

### Public Member Functions

virtual void | visit (T1)=0
virtual void | visit (T2)=0
virtual void | visit (T3)=0
virtual void | visit (T4)=0
virtual void | visit (T5)=0
virtual void | visit (T6)=0
virtual void | visit (T7)=0
virtual void | visit (T8)=0
virtual void | visit (T9)=0
virtual void | visit (T10)=0
virtual void | visit (T11)=0
virtual void | visit (T12)=0
virtual void | visit (T13)=0

## etl::visitor< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12 >

class etl::visitor< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12 >

template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12>
class etl::visitor< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12 >

The visitor base class for twelve types. Derive visitors from this.

### Public Member Functions

virtual void | visit (T1)=0
virtual void | visit (T2)=0
virtual void | visit (T3)=0
virtual void | visit (T4)=0
virtual void | visit (T5)=0
virtual void | visit (T6)=0
virtual void | visit (T7)=0
virtual void | visit (T8)=0
virtual void | visit (T9)=0
virtual void | visit (T10)=0
virtual void | visit (T11)=0
virtual void | visit (T12)=0

## etl::visitor< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11 >

class etl::visitor< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11 >

template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11>
class etl::visitor< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11 >

The visitor base class for eleven types. Derive visitors from this.

### Public Member Functions

virtual void | visit (T1)=0
virtual void | visit (T2)=0
virtual void | visit (T3)=0
virtual void | visit (T4)=0
virtual void | visit (T5)=0
virtual void | visit (T6)=0
virtual void | visit (T7)=0
virtual void | visit (T8)=0
virtual void | visit (T9)=0
virtual void | visit (T10)=0
virtual void | visit (T11)=0

## etl::visitor< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 >

class etl::visitor< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 >

template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10>
class etl::visitor< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 >

The visitor base class for ten types. Derive visitors from this.

### Public Member Functions

virtual void | visit (T1)=0
virtual void | visit (T2)=0
virtual void | visit (T3)=0
virtual void | visit (T4)=0
virtual void | visit (T5)=0
virtual void | visit (T6)=0
virtual void | visit (T7)=0
virtual void | visit (T8)=0
virtual void | visit (T9)=0
virtual void | visit (T10)=0

## etl::visitor< T1, T2, T3, T4, T5, T6, T7, T8, T9 >

class etl::visitor< T1, T2, T3, T4, T5, T6, T7, T8, T9 >

template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>
class etl::visitor< T1, T2, T3, T4, T5, T6, T7, T8, T9 >

The visitor base class for nine types. Derive visitors from this.

### Public Member Functions

virtual void | visit (T1)=0
virtual void | visit (T2)=0
virtual void | visit (T3)=0
virtual void | visit (T4)=0
virtual void | visit (T5)=0
virtual void | visit (T6)=0
virtual void | visit (T7)=0
virtual void | visit (T8)=0
virtual void | visit (T9)=0

## etl::visitor< T1, T2, T3, T4, T5, T6, T7, T8 >

class etl::visitor< T1, T2, T3, T4, T5, T6, T7, T8 >

template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
class etl::visitor< T1, T2, T3, T4, T5, T6, T7, T8 >

The visitor base class for eight types. Derive visitors from this.

### Public Member Functions

virtual void | visit (T1)=0
virtual void | visit (T2)=0
virtual void | visit (T3)=0
virtual void | visit (T4)=0
virtual void | visit (T5)=0
virtual void | visit (T6)=0
virtual void | visit (T7)=0
virtual void | visit (T8)=0

## etl::visitor< T1, T2, T3, T4, T5, T6, T7 >

class etl::visitor< T1, T2, T3, T4, T5, T6, T7 >

template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
class etl::visitor< T1, T2, T3, T4, T5, T6, T7 >

The visitor base class for seven types. Derive visitors from this.

### Public Member Functions

virtual void | visit (T1)=0
virtual void | visit (T2)=0
virtual void | visit (T3)=0
virtual void | visit (T4)=0
virtual void | visit (T5)=0
virtual void | visit (T6)=0
virtual void | visit (T7)=0

## etl::visitor< T1, T2, T3, T4, T5, T6 >

class etl::visitor< T1, T2, T3, T4, T5, T6 >

template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
class etl::visitor< T1, T2, T3, T4, T5, T6 >

The visitor base class for six types. Derive visitors from this.

### Public Member Functions

virtual void | visit (T1)=0
virtual void | visit (T2)=0
virtual void | visit (T3)=0
virtual void | visit (T4)=0
virtual void | visit (T5)=0
virtual void | visit (T6)=0

## etl::visitor< T1, T2, T3, T4, T5 >

class etl::visitor< T1, T2, T3, T4, T5 >

template<typename T1, typename T2, typename T3, typename T4, typename T5>
class etl::visitor< T1, T2, T3, T4, T5 >

The visitor base class for five types. Derive visitors from this.

### Public Member Functions

virtual void | visit (T1)=0
virtual void | visit (T2)=0
virtual void | visit (T3)=0
virtual void | visit (T4)=0
virtual void | visit (T5)=0

## etl::visitor< T1, T2, T3, T4 >

class etl::visitor< T1, T2, T3, T4 >

template<typename T1, typename T2, typename T3, typename T4>
class etl::visitor< T1, T2, T3, T4 >

The visitor base class for four types. Derive visitors from this.

### Public Member Functions

virtual void | visit (T1)=0
virtual void | visit (T2)=0
virtual void | visit (T3)=0
virtual void | visit (T4)=0

## etl::visitor< T1, T2, T3 >

class etl::visitor< T1, T2, T3 >

template<typename T1, typename T2, typename T3>
class etl::visitor< T1, T2, T3 >

The visitor base class for three types. Derive visitors from this.

### Public Member Functions

virtual void | visit (T1)=0
virtual void | visit (T2)=0
virtual void | visit (T3)=0

## etl::visitor< T1, T2 >

class etl::visitor< T1, T2 >

template<typename T1, typename T2>
class etl::visitor< T1, T2 >

The visitor base class for two types. Derive visitors from this.

### Public Member Functions

virtual void | visit (T1)=0
virtual void | visit (T2)=0

## etl::visitor< T1 >

class etl::visitor< T1 >

template<typename T1>
class etl::visitor< T1 >

The visitor base class for one type. Derive visitors from this.

### Public Member Functions

virtual void | visit (T1)=0

## etl::is_visitor

struct etl::is_visitor

template<typename T>
struct etl::is_visitor< T >

Is the type an etl::visitor?

## Additional Inherited Members

Public Types inherited from etl::integral_constant< bool, BValue >
typedef bool | value_type
typedef integral_constant< bool, VALUE > | type
Public Member Functions inherited from etl::integral_constant< bool, BValue >
| operator value_type () const
Static Public Attributes inherited from etl::integral_constant< bool, BValue >
static const bool | value