|
Table.hGo to the documentation of this file.00001 // -*- mode: C++ -*- 00002 // 00003 // Copyright (C) 2006 Christian Holm Christensen <cholm@nbi.dk> 00004 // 00005 // This library is free software; you can redistribute it and/or 00006 // modify it under the terms of the GNU Lesser General Public License 00007 // as published by the Free Software Foundation; either version 2.1 00008 // of the License, or (at your option) any later version. 00009 // 00010 // This library 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 GNU 00013 // Lesser General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU Lesser General Public 00016 // License along with this library; if not, write to the Free 00017 // Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 00018 // 02111-1307 USA 00019 // 00025 #ifndef RCUCONF_TABLE_H 00026 #define RCUCONF_TABLE_H 00027 #ifndef __STRING__ 00028 # include <string> 00029 #endif 00030 namespace RcuDb 00031 { 00032 class Server; 00033 class Row; 00034 } 00035 00036 namespace RcuConf 00037 { 00038 00043 class Table 00044 { 00045 public: 00047 virtual ~Table() {} 00051 virtual bool Insert(RcuDb::Server& server) = 0; 00054 int Id() const { return fId; } 00059 static bool Drop(RcuDb::Server& server, const std::string& table); 00060 protected: 00062 Table() : fId(-1) {} 00064 Table(const Table& table) : fId(table.fId) {} 00066 Table(RcuDb::Row& row); 00069 bool MakeId(RcuDb::Server& server); 00071 int fId; 00072 }; 00073 } 00074 00075 #endif 00076 // 00077 // EOF 00078 // 00079 00080
|