BOSS 7.0.2
BESIII Offline Software System
Loading...
Searching...
No Matches
Calibration/rdbModel/rdbModel-00-01-01/rdbModel/Db/MysqlResults.h
Go to the documentation of this file.
1// $Header: /bes/bes/BossCvs/Calibration/rdbModel/rdbModel/Db/MysqlResults.h,v 1.2 2008/04/09 02:57:28 huangb Exp $
2#ifndef RDBMODEL_MYSQLRESULTS_H
3#define RDBMODEL_MYSQLRESULTS_H
4
5#include "rdbModel/Db/ResultHandle.h"
6
7typedef struct st_mysql_res MYSQL_RES;
8
9namespace rdbModel{
10
11 class MysqlConnection;
12
13 /**
14 Concrete implementation of ResultHandle, to accompany MysqlConnection.
15 */
16 class MysqlResults : virtual public ResultHandle {
17 friend class MysqlConnection;
18
19 public:
20 virtual ~MysqlResults();
21
22 /// Return number of rows in results
23 virtual unsigned int getNRows() const;
24
25 /**
26 Get array of field values for ith row of result set
27 */
28 virtual bool getRow(std::vector<std::string>& fields, unsigned int i = 0,
29 bool clear = true);
30
31 /**
32 Get array of field values for ith row of result set. If a field
33 value is NULL, return a zero ptr for that element of the array.
34
35 --> It is the responsibility of the caller to delete the strings
36 containing the field values. See service cleanFieldPtrs
37 in base class ResultHandle.
38 */
39 virtual bool getRowPtrs(std::vector<std::string*>& fieldPtrs,
40 unsigned int i = 0, bool clear=true);
41
42 virtual bool getRowCon(char* par,unsigned long* treesize,unsigned int *runFrm,
43 unsigned int *runTo,unsigned int i = 0, bool clear=true);
44 /*
45 // Return specified row in results as a string
46 virtual bool getRowString(std::string& row, unsigned int iRow=0) const;
47
48 Return vector of rows
49 @param rows to hold returned data
50 @param iRow starting row
51 @param maxRow maximum number of rows requested. 0 means "all"
52 @param clear if true, clear @a rows before storing new data
53 @return status
54
55 virtual bool getRowStrings(std::vector<std::string>& rows,
56 unsigned int iRow=0,
57 unsigned int maxRow=0, bool clear=true) const;
58 */
59
60 private:
61 // Only MysqlConnection calls constructor
62 MysqlResults(MYSQL_RES* results = 0);
63
64 MYSQL_RES* m_myres;
65 };
66}
67#endif
virtual bool getRow(std::vector< std::string > &fields, unsigned int i=0, bool clear=true)
virtual bool getRowCon(char *par, unsigned long *treesize, unsigned int *runFrm, unsigned int *runTo, unsigned int i=0, bool clear=true)
virtual unsigned int getNRows() const
Return number of rows in results.
virtual bool getRowPtrs(std::vector< std::string * > &fieldPtrs, unsigned int i=0, bool clear=true)