src/DAL/Statements.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2008 by Sverre Rabbelier                                *
00003  *   sverre@rabbelier.nl                                                   *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 3 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 
00021 #pragma once
00022 
00030 #include "Types.h"
00031 
00035 class Statements
00036 {
00037 public:
00039         Statements();   
00040         
00042         ~Statements();
00043         
00045         sqlite3_stmt* getErase() const;
00046         
00048         sqlite3_stmt* getInsert() const;
00049         
00051         sqlite3_stmt* getUpdate() const;
00052         
00054         sqlite3_stmt* getSelect() const;
00055         
00057         sqlite3_stmt* getLookup(FieldPtr field);
00058         
00060         sqlite3_stmt* getList() const;
00061         
00062         
00064         void setErase(sqlite3_stmt* erase);
00065         
00067         void setInsert(sqlite3_stmt* insert);
00068         
00070         void setUpdate(sqlite3_stmt* update);
00071         
00073         void setSelect(sqlite3_stmt* select);
00074         
00076         void setLookup(FieldPtr field, sqlite3_stmt* lookup);
00077         
00079         void setList(sqlite3_stmt* list);       
00080         
00082         void commit();
00083         
00084 private:
00085         typedef std::map<Field*, sqlite3_stmt*> fieldmap; 
00087         sqlite3_stmt* m_insert; 
00088         sqlite3_stmt* m_erase; 
00089         sqlite3_stmt* m_update; 
00090         sqlite3_stmt* m_select; 
00091         fieldmap m_lookup; 
00092         sqlite3_stmt* m_list; 
00093 };
00094 
00095 typedef SmartPtr<Statements> StatementsPtr; 

Generated for UnsignedByte by  doxygen 1.5.3
SourceForge.net Logo