All Frameworks  Class Hierarchy  This Framework  Indexes   

KnowledgeInterfaces Interface CATIVisitor

Usage: you can reimplement this interface by deriving the supplied CATVisitorAdapter adapter class.


interface CATIVisitor

Interface dedicated to implementing a visitor pattern.
Role: The visitor performs operations on objects submitted by a provider (cf. Design Patterns by the Gang of Four, Addison-Wesley, chapter 5 "Visitor").
The provider scans recursively a structure and submit objects to the visitor. The visitor returns a result code indicating if the scan should continue or not.
It provides performance improvements over the method consisting in creating a list of interesting elements and then performing operations on them.

BOA information: this interface CAN be implemented using the BOA (Basic Object Adapter). To know more about the BOA, refer to the CAA Encyclopedia home page. Click Middleware at the bottom left, then click the Object Modeler tab page. Several articles deal with the BOA.


Method Index


o SpecialDataNeeded()
In some cases, special data is needed to be visited.
o VisitPublisherForRecursion(CATIParmPublisher_var&)
For optimization purpose.
o Visit(CATBaseUnknown*)
Operates on the submitted object and returns a continuation code.

Methods


o SpecialDataNeeded
public virtual SpecialDataNeeded()
In some cases, special data is needed to be visited.
Returns:
NULL if no special data is to be visited, else a list of strings containing format specifications (these formats have to be discussed between callers and providers)
o VisitPublisherForRecursion
public virtual VisitPublisherForRecursion( const publisher)
For optimization purpose. if VisitChildren is called with recursive argument, allows to control if given publisher is to be visited
Parameters:
the
tested publisher
Returns:
S_OK if the publisher is to be visited, E_FAIL else
o Visit
public virtual Visit( iInstance)
Operates on the submitted object and returns a continuation code.
Parameters:
iInstance
Object to be performed on.
Returns:
S_OK to continue the scan, E_FAIL to stop.

This object is included in the file: CATIVisitor.h
If needed, your Imakefile.mk should include the module: KnowledgeItf

Copyright © 2003, Dassault Systèmes. All rights reserved.