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

CdbBdbObjectProfilerUserAction.hh

Go to the documentation of this file.
00001 #ifndef CDBBDB_OBJECT_PROFILER_USER_ACTION_HH
00002 #define CDBBDB_OBJECT_PROFILER_USER_ACTION_HH
00003 
00004 // File and Version Information:
00005 //      $Id: CdbBdbObjectProfilerUserAction.hh,v 1.2 2004/10/21 20:35:50 gapon Exp $
00006 
00007 #include "CdbBase/CdbCommon.hh"
00008 
00009 #include <oo.h>     // ooRef(ooObj), ooHandle(ooObj)
00010 
00011 /// The base class for user defined actions
00012 /**
00013   * This base class has to implemented by users willing to control
00014   * the "profiler" navigation in complex graphs.
00015   * 
00016   * IMPLEMENTATION NOTES:
00017   *
00018   *   (1) This class violates CDB API convention on the inclusion
00019   *       of "CdbBase/CdbCommon.hh" header file to avoid STD namespace
00020   *       conflicts of the kind described above.
00021   */
00022 class CdbBdbObjectProfilerUserAction {
00023 
00024 public:
00025 
00026   /// These values will be used to indicate the user's response
00027 
00028     typedef enum { ACTION_PROCEED,
00029                    ACTION_STOP,
00030                    ACTION_ERROR } ActionType;
00031 
00032 public:
00033 
00034   /// The constructor
00035   /**
00036     * Inityialize's the object's parameters.
00037     */
00038     CdbBdbObjectProfilerUserAction( bool verboseMode = false,
00039                                     bool debugMode   = false );
00040 
00041   /// The destructor
00042   /**
00043     * Moe details...
00044     */
00045     virtual ~CdbBdbObjectProfilerUserAction( );
00046 
00047   /// Let a user to make a decision on what has to be done next
00048   /**
00049     * This wrapper method takes the "about-to-be-profiled" link on the input. Ths link
00050     * is evaluated by the method to report what's the next action should be.
00051     *
00052     * The second parameter passed town to the operation is the current context
00053     * description in which the link has to be evaluated.
00054     *
00055     * Here is the explanation of possible responses:
00056     *
00057     *   ACTION_PROCEED : a caller has to proceed and profile this node.
00058     *
00059     *   ACTION_STOP    : a caller should stop and not to propagate along this link.
00060     *
00061     *   ACTION_ERROR   : an error has happened inside the method. Normally the caller
00062     *                    should stop profiling any further links.
00063     *
00064     * HOW IT WORKS:
00065     *
00066     *   - first of all this method will verify if the passed object is valid and return
00067     *     the ACTION_ERROR value if it's not.
00068     *
00069     *   - if the passed object is valid then a user defined "userAction"
00070     *     application's object will be called to let a user to proceed with his/her
00071     *     actions in the passed object's context.
00072     *
00073     * @see CdbBdbObjectProfilerUserAction::userAction()
00074     * @see class CdbBdbObjectProfilerContext
00075     */
00076     ActionType action( const ooHandle(ooObj)& theInputH );
00077 
00078 protected:
00079 
00080   /// Let a user to make a decision on what has to be done next (ACTUAL USER ACTION)
00081   /**
00082     * This method gets called only for valid objects.
00083     *
00084     * IMPLEMENTATION NOTE: In its default implementation this method would always
00085     *                      return ACTION_PROCEED. This behaviour can be overriten
00086     *                      by specific subclasses.
00087     *
00088     * @see CdbBdbObjectProfilerUserAction::action()
00089     * @see class CdbBdbObjectProfilerContext
00090     */
00091     virtual ActionType userAction( const ooHandle(ooObj)& theInputH );
00092 
00093 private:
00094 
00095   // Parameters
00096 
00097     bool _verboseMode;
00098     bool _debugMode;
00099 };
00100 
00101 #endif  // CDBBDB_OBJECT_PROFILER_USER_ACTION_HH

Generated on Mon Dec 5 18:22:00 2005 for CDB by doxygen1.3-rc3