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

CdbBdbPrintObjectTreeUserAction.hh

Go to the documentation of this file.
00001 #ifndef CDBBDB_PRINT_OBJECT_TREE_USER_ACTION_HH
00002 #define CDBBDB_PRINT_OBJECT_TREE_USER_ACTION_HH
00003 
00004 // File and Version Information:
00005 //      $Id: CdbBdbPrintObjectTreeUserAction.hh,v 1.2 2004/10/21 20:35:51 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 "print object children" 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 CdbBdbPrintObjectTreeUserAction {
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     CdbBdbPrintObjectTreeUserAction( bool verboseMode = false,
00039                                      bool debugMode   = false );
00040 
00041   /// The destructor
00042   /**
00043     * Moe details...
00044     */
00045     virtual ~CdbBdbPrintObjectTreeUserAction( );
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-printed" 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 print 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 printing 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 CdbBdbPrintObjectTreeUserAction::userAction()
00074     */
00075     ActionType action( const ooHandle(ooObj)& theInputH );
00076 
00077 protected:
00078 
00079   /// Let a user to make a decision on what has to be done next (ACTUAL USER ACTION)
00080   /**
00081     * This method gets called only for valid objects.
00082     *
00083     * IMPLEMENTATION NOTE: In its default implementation this method would always
00084     *                      return ACTION_PROCEED. This behaviour can be overriten
00085     *                      by specific subclasses.
00086     *
00087     * @see CdbBdbPrintObjectTreeUserAction::action()
00088     */
00089     virtual ActionType userAction( const ooHandle(ooObj)& theInputH );
00090 
00091 private:
00092 
00093   // Parameters
00094 
00095     bool _verboseMode;
00096     bool _debugMode;
00097 };
00098 
00099 #endif  // CDBBDB_PRINT_OBJECT_TREE_USER_ACTION_HH

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