00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _TMWSERV_RECORDSET_H_
00022 #define _TMWSERV_RECORDSET_H_
00023
00024 #include <iostream>
00025 #include <vector>
00026
00027 namespace dal
00028 {
00029
00030
00034 typedef std::vector<std::string> Row;
00035
00036
00045 class RecordSet
00046 {
00047 public:
00051 RecordSet(void)
00052 throw();
00053
00054
00058 ~RecordSet(void)
00059 throw();
00060
00061
00065 void
00066 clear(void);
00067
00068
00074 bool
00075 isEmpty(void) const;
00076
00077
00083 unsigned int
00084 rows(void) const;
00085
00086
00092 unsigned int
00093 cols(void) const;
00094
00095
00104 void
00105 setColumnHeaders(const Row& headers);
00106
00107
00121 void
00122 add(const Row& row);
00123
00124
00138 const std::string&
00139 operator()(const unsigned int row,
00140 const unsigned int col) const;
00141
00142
00157 const std::string&
00158 operator()(const unsigned int row,
00159 const std::string& name) const;
00160
00161
00171 friend std::ostream&
00172 operator<<(std::ostream& out, const RecordSet& rhs);
00173
00174
00175 private:
00179 RecordSet(const RecordSet& rhs);
00180
00181
00185 RecordSet&
00186 operator=(const RecordSet& rhs);
00187
00188
00189 private:
00190 Row mHeaders;
00191 typedef std::vector<Row> Rows;
00192 Rows mRows;
00193 };
00194
00195
00196 }
00197
00198 #endif // _TMWSERV_RECORDSET_H_