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

lCmds.cpp

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 // Standard Header(s)
00016 #include <malloc.h>
00017 #include <string.h>
00018 
00019 // Own Header
00020 #include <lCmds.h>        // SQL commands
00021 
00022 // Other POLiTe Header(s)
00023 #include <cConnection.h>
00024 
00026 // class Cmd
00027 
00029 // class Cmd0: Cmd
00030 
00032 // class Cmd1: Cmd
00033 
00034 Cmd1::Cmd1()
00035 {
00036         _param1 = NULL;
00037         };
00038 
00039 Cmd1::Cmd1(const char * const a_param1)
00040 {
00041         if (a_param1 == NULL)
00042                 _param1 = NULL;
00043         else {
00044                 _param1 = (char *)malloc(strlen(a_param1)+1);
00045                 strcpy(_param1,a_param1);
00046                 };
00047         };
00048 
00049 Cmd1 &Cmd1::operator = (const Cmd1 &Src)
00050 {
00051         if (this == &Src)
00052                 return(*this);
00053         if (!_param1)
00054                 free(_param1);
00055         _param1 = (char *)malloc(strlen(Src._param1)+1);
00056         strcpy(_param1,Src._param1);
00057         return(*this);
00058         };
00059 
00060 Cmd1::~Cmd1()
00061 {
00062         if (_param1 == NULL)
00063                 free(_param1);
00064                 };
00065 
00067 // class CmdCommit: Cmd0
00068 
00069 bool CmdCommit::ExecuteCommand(
00070                 class Connection &DbConn
00071                 ) const
00072 {
00073         return(DbConn.Commit());
00074         };
00075 
00077 // class CmdCommit: Cmd0
00078 
00079 bool CmdRollback::ExecuteCommand(
00080                 class Connection &DbConn
00081                 ) const
00082 {
00083         return(DbConn.Rollback());
00084         };
00085 
00087 // class CmdSavepoint: Cmd0
00088 
00089 bool CmdSavepoint::ExecuteCommand(
00090                 class Connection &DbConn
00091                 ) const
00092 {
00093         return(DbConn.Savepoint(_param1));
00094         };
00095 
00097 // class CmdRollbackToSavepoint: Cmd0
00098 
00099 bool CmdRollbackToSavepoint::ExecuteCommand(
00100                 class Connection &DbConn
00101                 ) const
00102 {
00103         return(DbConn.RollbackToSavepoint(_param1));
00104         };
00105 
00107 // class CmdSql: Cmd0
00108 
00109 bool CmdSql::ExecuteCommand(
00110                 class Connection &DbConn
00111                 ) const
00112 {
00113         return(DbConn.Sql(_param1));
00114         };
00115 

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