libdballe
5.18
|
00001 /* 00002 * db/station - station table management 00003 * 00004 * Copyright (C) 2005--2010 ARPA-SIM <urpsim@smr.arpa.emr.it> 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License. 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 Free Software 00017 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00018 * 00019 * Author: Enrico Zini <enrico@enricozini.com> 00020 */ 00021 00022 #ifndef DBALLE_DB_STATION_H 00023 #define DBALLE_DB_STATION_H 00024 00031 #include <dballe/db/odbcworkarounds.h> 00032 #include <sqltypes.h> 00033 #include <cstdio> 00034 00035 namespace dballe { 00036 struct DB; 00037 00038 namespace db { 00039 struct Connection; 00040 struct Statement; 00041 00045 struct Station 00046 { 00050 DB& db; 00051 00053 db::Statement* sfstm; 00055 db::Statement* smstm; 00057 db::Statement* sstm; 00059 db::Statement* istm; 00061 db::Statement* ustm; 00063 db::Statement* dstm; 00064 00066 DBALLE_SQL_C_SINT_TYPE id; 00068 DBALLE_SQL_C_SINT_TYPE lat; 00070 DBALLE_SQL_C_SINT_TYPE lon; 00072 char ident[64]; 00074 SQLLEN ident_ind; 00075 00076 Station(DB& conn); 00077 ~Station(); 00078 00085 void set_ident(const char* ident); 00086 00093 int get_id(); 00094 00101 void get_data(int id); 00102 00109 int insert(); 00110 00114 void update(); 00115 00119 void remove(); 00120 00124 void dump(FILE* out); 00125 00126 private: 00127 // disallow copy 00128 Station(const Station&); 00129 Station& operator=(const Station&); 00130 }; 00131 00132 #if 0 00133 00134 00135 #ifdef __cplusplus 00136 } 00137 #endif 00138 00139 #endif 00140 00141 } // namespace db 00142 } // namespace dballe 00143 00144 /* vim:set ts=4 sw=4: */ 00145 #endif