TVisitor
Base class for the implementation of the Visitor pattern.
Inheritance
Level | Ancestor | Description |
---|---|---|
1 | TObject | Ultimate ancestor in a class hierarchy |
2 | TVisitor |
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
Scope | Visibility | Result | Name | Description |
---|---|---|---|---|
Instance | protected | TText | GetMethodName(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. |
Instance | protected | TPointer | GetMethodAddress(Prefix: TText; Value: TObject; Suffix: TText) | |
Instance | protected | PrepareMethod(Method: TMethod; Prefix: TText; Value: TObject; Suffix: TText; RaiseException: TBoolean) | ||
Instance | protected | Visit(Prefix: TText; Value: TObject; Suffix: TText) | Call the published visit procedure with name Prefix+GetMethodName(Value)+Suffix . | |
Instance | protected | TObject | VisitWithResult(Prefix: TText; Value: TObject; Suffix: TText) | Call the published visit function with name Prefix+GetMethodName(Value)+Suffix and return its result. |