Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

CdbBdbObjectVisitor Class Reference

This class provides "object visitor" facility for persistent objects. More...

#include <CdbBdbObjectVisitor.hh>

List of all members.

Public Member Functions

 CdbBdbObjectVisitor (CdbBdbObjectVisitorUserAction *theUserAction, bool verboseMode=false, bool debugMode=false)
 Normal constructor.

virtual ~CdbBdbObjectVisitor ()
 Destructor.

bool visit (const ooHandle(ooObj)&theInputH)
 Visit the specified object.

CdbBdbObjectVisitorUserActionsetUserAction (CdbBdbObjectVisitorUserAction *theUserAction)
 Set user action.


Detailed Description

This class provides "object visitor" facility for persistent objects.

This facility uses the Objectivity/DB Active Schema API to navigate accross an arbitrary graph of objects by visiting each node and calling a user defined action at each node. Each node is visited just once. A user defined action object provides a feedback wether the visiting should propagate beyond a visited node or it should stop at this node or it should break visiting due to a error.

IMPLEMENTATION NOTES:

(1) This class uses PIMPL idiom to protect end users of the class from being exposed to the buggy header files of the Objectivity/DB Active Schema API.

(2) This class violates CDB API convention on the inclusion of "CdbBase/CdbCommon.hh" header file to avoid STD namespace conflicts of the kind described above.

ATTENTION:

Definition at line 39 of file CdbBdbObjectVisitor.hh.


Constructor & Destructor Documentation

CdbBdbObjectVisitor::CdbBdbObjectVisitor CdbBdbObjectVisitorUserAction   theUserAction,
bool    verboseMode = false,
bool    debugMode = false
 

Normal constructor.

Sets the initial context for the visiting. This context can be reused accross multiple calls to the visiting method itself.

A non-zero pointer onto a user defined action is required.

The ownership to a user action does not get transferred into the current object. We may need non-const pointer to let a user to maintain the context of user action between calls.

Note, a user action object can be overriden by passing another user action object by calling a special "setUserAction" method.

Definition at line 15 of file CdbBdbObjectVisitor.cc.

CdbBdbObjectVisitor::~CdbBdbObjectVisitor   [virtual]
 

Destructor.

More details...

Definition at line 23 of file CdbBdbObjectVisitor.cc.


Member Function Documentation

CdbBdbObjectVisitorUserAction * CdbBdbObjectVisitor::setUserAction CdbBdbObjectVisitorUserAction   theUserAction
 

Set user action.

If 0 pointer is passed then the current user action will be reset and it will not be called anymore.

The method will return a pointer onto the previous action (if any).

See also:
class CdbBdbObjectVisitorUserAction

Definition at line 36 of file CdbBdbObjectVisitor.cc.

References CdbBdbObjectVisitorImpl::setUserAction().

bool CdbBdbObjectVisitor::visit const ooHandle(ooObj)&    theInputH
 

Visit the specified object.

The operation will return "true" in case of success, it will return "false" in case of any errors.

Definition at line 30 of file CdbBdbObjectVisitor.cc.

References CdbBdbObjectVisitorImpl::visit().


The documentation for this class was generated from the following files:
Generated on Mon Dec 5 18:22:18 2005 for CDB by doxygen1.3-rc3