TVisitor

Base class for the implementation of the Visitor pattern.

Inheritance

LevelAncestorDescription
1TObjectUltimate ancestor in a class hierarchy
2TVisitor

Source

Visitor.pas (35)

Description

TVisitor works by dynamically dispatching visition function calls at runtime to correctly named published visit functions: VisitX(), where X is the class name of the visited object.

Methods

ScopeVisibilityResultNameDescription
InstanceprotectedTTextGetMethodName(Value: TObject)Determine the name of the function to visit for the provided Value. The default implementation strips the T of the classname of the object.
InstanceprotectedTPointerGetMethodAddress(Prefix: TText; Value: TObject; Suffix: TText)
InstanceprotectedPrepareMethod(Method: TMethod; Prefix: TText; Value: TObject; Suffix: TText; RaiseException: TBoolean)
InstanceprotectedVisit(Prefix: TText; Value: TObject; Suffix: TText)Call the published visit procedure with name Prefix+GetMethodName(Value)+Suffix.
InstanceprotectedTObjectVisitWithResult(Prefix: TText; Value: TObject; Suffix: TText)Call the published visit function with name Prefix+GetMethodName(Value)+Suffix and return its result.