Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

dsSQLWrapper.h

Go to the documentation of this file.
00001 /*
00002  * $Id: dsSQLWrapper.h,v 1.8 2003/10/17 13:05:16 dsamersoff Exp $
00003  *
00004  */
00005 
00006 #ifndef dsSQLWrapper_h
00007 #define dsSQLWrapper_h
00008 
00009 #include <stdlib.h>
00010 #include <string.h>
00011 
00012 #include <iostream>
00013 #include <list>
00014 
00015 #include <dsSmartException.h>
00016 #include <dsSQLAccessor.h>
00017          
00018 /* Fake macros to make wrapper code self-documented
00019  */ 
00020 #define SQLIN
00021 #define SQLOUT
00022 #define SQLNONE
00023 
00024 #define IMPORT(name)
00025 
00034 class dsSQLWrapper
00035 {
00036 protected:
00037 
00038     virtual void Execute(dsSQLAccessor *pg)  = 0;
00039 
00040     virtual ~dsSQLWrapper()
00041     {
00042       /* do nothing here, just to keep it virtual */
00043     }
00044 };
00045 
00051 class dsSQLRset
00052 {
00053 protected:
00054     void Define(dsSQLAccessor *pg, void *cursor);
00055 };
00056 
00057 
00058 
00067 template <class TRset> 
00068 class dsSQListWrapper : public dsSQLWrapper
00069 {
00070 public:
00071    TRset rs;
00072    
00073    std::list <TRset *> _lst;
00074 
00075    ~dsSQListWrapper()
00076     {
00077         typename std::list<TRset *>::iterator iter;
00078 
00079         for (iter = _lst.begin(); iter != _lst.end(); ++iter)
00080          {
00081              delete (*iter);
00082          }
00083 
00084         _lst.clear();
00085     }
00086   
00087 };
00088 
00089 
00090 #endif

Generated on Mon May 16 18:26:58 2005 for libdms4 by doxygen1.3-rc2