| | | | <- prev | |

Generalized Functors

  • Command Design Pattern
    1. Client creates ConcreteCommand com(p1,...,pk) object, with parameter types
    2. com passed to invoker, which stores it
    3. At later time, com(a1,...,ak) is executed with arguments
  • Interface separation
  • Time separation
  • Goal: Functor class template that encapsulates
    1. Any object
    2. Any member function of the object
    3. Any set of arguments for the member function
    executes on command

Source: Andrei Alexandrescu, Modern C++ Design, Addison-Wesley, 2001


<- prev | | Top of Page | 8. Generalized Functors - 1 of 26