Single-serving Visitor Pattern - Usage Examples

Usage Examples

The single-serving visitor is called through the intermediate of static methods.

  • Without parameters:
Element* elem; SingleServingVisitor::apply_to(elem);
  • With parameters:
Element* elem; TYPE param1, param2; SingleServingVisitor::apply_to(elem, param1, param2);
  • Implementation as a singleton:
Element* elem; TYPE param1, param2; SingleServingVisitor::set_param1(param1); SingleServingVisitor::set_param2(param2); SingleServingVisitor::apply_to(elem);

Read more about this topic:  Single-serving Visitor Pattern

Famous quotes containing the words usage and/or examples:

    I am using it [the word ‘perceive’] here in such a way that to say of an object that it is perceived does not entail saying that it exists in any sense at all. And this is a perfectly correct and familiar usage of the word.
    —A.J. (Alfred Jules)

    No rules exist, and examples are simply life-savers answering the appeals of rules making vain attempts to exist.
    André Breton (1896–1966)