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

CdbBdbObjectClone Class Reference

This class provides "deep clone" facility for persistent objects. More...

#include <CdbBdbObjectClone.hh>

List of all members.

Public Member Functions

 CdbBdbObjectClone (const ooRef(ooObj)&theHint=0, CdbBdbObjectCloneUserAction *theUserAction=0, bool deepCopyMode=false, bool verboseMode=false, bool debugMode=false)
 Normal constructor.

virtual ~CdbBdbObjectClone ()
 Destructor.

bool clone (const ooHandle(ooObj)&theInputH, ooHandle(ooObj)&theOutputH)
 Make a persistent clone of the specified object.

 ooRef (ooObj) setHint(const ooRef(ooObj)&theHint)
 Set hint.

CdbBdbObjectCloneUserActionsetUserAction (CdbBdbObjectCloneUserAction *theUserAction)
 Set user action.


Detailed Description

This class provides "deep clone" facility for persistent objects.

This facility uses the Objectivity/DB Active Schema API to clone persistent objects.

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.

Definition at line 31 of file CdbBdbObjectClone.hh.


Constructor & Destructor Documentation

CdbBdbObjectClone::CdbBdbObjectClone const ooRef(ooObj)&    theHint = 0,
CdbBdbObjectCloneUserAction   theUserAction = 0,
bool    deepCopyMode = false,
bool    verboseMode = false,
bool    debugMode = false
 

Normal constructor.

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

If the hint is not set then it will have to be set before attempting to copy. Otherwise the clone method will fail.

The ownership to a user action (if any) 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 cation object when calling the cloning method.

Definition at line 15 of file CdbBdbObjectClone.cc.

CdbBdbObjectClone::~CdbBdbObjectClone   [virtual]
 

Destructor.

More details...

Definition at line 27 of file CdbBdbObjectClone.cc.


Member Function Documentation

bool CdbBdbObjectClone::clone const ooHandle(ooObj)&    theInputH,
ooHandle(ooObj)&    theOutputH
 

Make a persistent clone of the specified object.

It's guaranteed that the resulting object (if successfull) will be different from the output one. It will be placed into the location specified through the "hint" parameter passed to the class's constructor.

If the passed object refers other objects either via references or relationships and if the "deep clone" flag was passed to the class's constructor then the whole network of objects will be copied. Otherwise (if no "deep copy" flag is specified) then the resulting composite object will borrow external references/associations from the input one.

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

Definition at line 34 of file CdbBdbObjectClone.cc.

References CdbBdbObjectCloneImpl::clone().

Referenced by CdbBdbSMetaDataP::repoint().

CdbBdbObjectClone::ooRef ooObj    const
 

Set hint.

A valid hint object is expected. Otherwise the code will crash.

The method will return the previous value of the hint.

CdbBdbObjectCloneUserAction * CdbBdbObjectClone::setUserAction CdbBdbObjectCloneUserAction   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 CdbBdbObjectCloneUserAction

Definition at line 48 of file CdbBdbObjectClone.cc.

References CdbBdbObjectCloneImpl::setUserAction().


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