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)

    It is hardly to be believed how spiritual reflections when mixed with a little physics can hold people’s attention and give them a livelier idea of God than do the often ill-applied examples of his wrath.
    —G.C. (Georg Christoph)