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:

    ...Often the accurate answer to a usage question begins, “It depends.” And what it depends on most often is where you are, who you are, who your listeners or readers are, and what your purpose in speaking or writing is.
    Kenneth G. Wilson (b. 1923)

    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)