Generalized Functors
- Command Design Pattern
- Client creates ConcreteCommand com(p1,...,pk) object, with
parameter types
- com passed to invoker, which stores it
- At later time, com(a1,...,ak) is executed with arguments
- Interface separation
- Time separation
- Goal: Functor class template that encapsulates
- Any object
- Any member function of the object
- Any set of arguments for the member function
executes on command
Source: Andrei Alexandrescu, Modern C++ Design, Addison-Wesley, 2001
|