The Visitor ( download ) sample illustrates this design pattern as follows:
Car is a complex object with Body, Engine, and Wheel parts, all derived from the CarElement base.
CarElementVisitor is an abstract visitor interface, declaring operations to visit Body, Engine, and Wheels.
The CarElementPrintVisitor and CarElementDoVisitor are concrete visitors, each implementing the required visit() operation for every car element.