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

CdbBdbObjectProfiler Class Reference

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

#include <CdbBdbObjectProfiler.hh>

List of all members.

Public Member Functions

 CdbBdbObjectProfiler (CdbBdbObjectProfilerUserAction *theUserAction, bool verboseMode=false, bool debugMode=false)
 Normal constructor.

virtual ~CdbBdbObjectProfiler ()
 Destructor.

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

CdbBdbObjectProfilerUserActionsetUserAction (CdbBdbObjectProfilerUserAction *theUserAction)
 Set user action.

uint64 getSize () const
 Get current size.

uint64 getTopObjects () const
 Get current number of top-level objects.


Detailed Description

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

This facility uses the Objectivity/DB Active Schema API to navigate accross an arbitrary graph of objects by visiting and profiling (collecting the object's size satistic information for each node) and calling a user defined action at each node. Each node is visited/profiled just once. A user defined action object provides a feedback wether the profiling should propagate beyond a profiled node or it should stop at this node or it should break profiling 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 40 of file CdbBdbObjectProfiler.hh.


Constructor & Destructor Documentation

CdbBdbObjectProfiler::CdbBdbObjectProfiler CdbBdbObjectProfilerUserAction   theUserAction,
bool    verboseMode = false,
bool    debugMode = false
 

Normal constructor.

Sets the initial context for the profiling. This context can be reused accross multiple calls to the profiling 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 CdbBdbObjectProfiler.cc.

CdbBdbObjectProfiler::~CdbBdbObjectProfiler   [virtual]
 

Destructor.

More details...

Definition at line 23 of file CdbBdbObjectProfiler.cc.


Member Function Documentation

uint64 CdbBdbObjectProfiler::getSize   const
 

Get current size.

This method will return the number of bytes found by the profiler by the time of the current request get executed.

Definition at line 42 of file CdbBdbObjectProfiler.cc.

References CdbBdbObjectProfilerImpl::getSize().

uint64 CdbBdbObjectProfiler::getTopObjects   const
 

Get current number of top-level objects.

This method will return the number of "top-level" objects (not counting duplicated ones) processed by the profiler by the time of the current request get executed.

NOTES:

  • this procedure does NOT count "children" of composite "top-level" objects
  • it does NOT count those objects processed by a user defined action either

Definition at line 48 of file CdbBdbObjectProfiler.cc.

References CdbBdbObjectProfilerImpl::getTopObjects().

bool CdbBdbObjectProfiler::profile 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 CdbBdbObjectProfiler.cc.

References CdbBdbObjectProfilerImpl::profile().

CdbBdbObjectProfilerUserAction * CdbBdbObjectProfiler::setUserAction CdbBdbObjectProfilerUserAction   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 CdbBdbObjectProfilerUserAction

Definition at line 36 of file CdbBdbObjectProfiler.cc.

References CdbBdbObjectProfilerImpl::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