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

lCmds.h

Go to the documentation of this file.
00001 /******************************************************************************/
00002 /*                                                                            */
00003 /* POLiTe - Persistent Object Library Test                                    */
00004 /*                                        Ph.D. Thesis by Mgr. Michal Kopecky */
00005 /*                                                                            */
00006 /* Charles University Prague                                                  */
00007 /*                                                                            */
00008 /******************************************************************************/
00009 /*                                                                            */
00010 /* File name: ...                                                             */
00011 /* Module: ......                                                             */
00012 /*                                                                            */
00013 /******************************************************************************/
00014 /*                                                                            */
00015 /*  Declares the class hierarchy for SQL commands.                            */
00016 /*  it consists of following class hierarchy:                                 */
00017 /*                                                                            */
00018 /*  Cmd                                - abstract base class of the hierarchy */
00019 /*    Cmd0: public Cmd                 - abstract command w/o any parameter   */
00020 /*      CmdCommit: public Cmd0                                                */
00021 /*      CmdRollback: public Cmd0                                              */
00022 /*    Cmd1(param1): public: Cmd        - abstaract class with one parameter   */
00023 /*      CmdSavepoint(name): public Cmd1                                       */
00024 /*      CmdRollbackToSavepoint(name): public Cmd1                             */
00025 /*      CmdSql(SqlCommand): public Cmd1                                       */
00026 /*                                                                            */
00027 /******************************************************************************/
00028 
00029 #ifndef __L_CMDS_H__
00030 #define __L_CMDS_H__
00031 
00032 
00033 // Common POLiTe Header(s)
00034 #include <lDefs.h>
00035 #include <lTypes.h>
00036 #include <lExceptions.h>
00037 
00038 class DLL_External Cmd 
00039 {
00040 public:
00041         Cmd() {};
00042         virtual ~Cmd() {};
00043         virtual bool ExecuteCommand(class Connection &DbConn) const = 0;
00044 };
00045 
00046 class DLL_External Cmd0 : public Cmd 
00047 {
00048 public:
00049         Cmd0() : Cmd() {};
00050         virtual ~Cmd0() {};
00051 };
00052 
00053 class DLL_External Cmd1 : public Cmd 
00054 {
00055 protected:
00056         char *_param1;
00057 public:
00058         Cmd1();
00059         Cmd1(const char * const a_param1);
00060         Cmd1 &operator = (const Cmd1 &Src);
00061         virtual ~Cmd1();
00062 };
00063 
00064 class DLL_External CmdCommit : public Cmd0 
00065 {
00066 public:
00067         CmdCommit() : Cmd0() {};
00068         virtual ~CmdCommit() {};
00069         virtual bool ExecuteCommand(class Connection &DbConn) const;
00070 };
00071 
00072 class DLL_External CmdRollback : public Cmd0 
00073 {
00074 public:
00075         CmdRollback() : Cmd0() {};
00076         virtual ~CmdRollback() {};
00077         virtual bool ExecuteCommand(class Connection &DbConn) const;
00078 };
00079 
00080 class DLL_External CmdSavepoint : public Cmd1 
00081 {
00082 public:
00083         CmdSavepoint(const char *const a_name) : Cmd1(a_name) {};
00084         CmdSavepoint(const CmdSavepoint &Src) : Cmd1(Src) {};
00085         virtual ~CmdSavepoint() {};
00086         virtual bool ExecuteCommand(class Connection &DbConn) const;
00087 };
00088 
00089 class DLL_External CmdRollbackToSavepoint : public Cmd1 
00090 {
00091 public:
00092         CmdRollbackToSavepoint(const char *const a_name) : Cmd1(a_name) {};
00093         CmdRollbackToSavepoint(const CmdRollbackToSavepoint &Src) : Cmd1(Src) {};
00094         virtual ~CmdRollbackToSavepoint() {};
00095         virtual bool ExecuteCommand(class Connection &DbConn) const;
00096 };
00097 
00098 class DLL_External CmdSql : public Cmd1 
00099 {
00100 public:
00101         CmdSql(const char *const a_sql) : Cmd1(a_sql) {};
00102         CmdSql(const CmdSql &Src) : Cmd1(Src) {};
00103         virtual ~CmdSql() {};
00104         virtual bool ExecuteCommand(class Connection &DbConn) const;
00105 };
00106 
00107 #endif  //__L_CMDS_H__

Generated on Sun Jul 14 20:51:15 2002 for POLiTe by doxygen1.2.16