BOSS 7.0.8
BESIII Offline Software System
Loading...
Searching...
No Matches
ResultHandle.h
Go to the documentation of this file.
1// $Header: /bes/bes/BossCvs/Calibration/rdbModel/rdbModel/Db/ResultHandle.h,v 1.2 2008/04/09 02:57:28 huangb Exp $
2#ifndef RDBMODEL_RESULTHANDLE_H
3#define RDBMODEL_RESULTHANDLE_H
4#include <vector>
5#include <string>
6
7
8namespace rdbModel{
9
10 /**
11 Pure virtual class representing results of a query. Each concrete
12 implementation of Connection will have an associated concrete
13 implementation of ResultHandle
14 */
16 public:
18 virtual ~ResultHandle() {};
19
20 /// Return number of rows in results
21 virtual unsigned int getNRows() const = 0;
22
23 /**
24 Get array of field values for ith row of result set
25 */
26 virtual bool getRow(std::vector<std::string>& fields, unsigned int i = 0,
27 bool clear = true) =0;
28
29 virtual bool getRowCon(char* par,unsigned long* treesize,unsigned int *runFrm,
30 unsigned int *runTo,unsigned int i = 0, bool clear=true) = 0;
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 */
38 virtual bool getRowPtrs(std::vector<std::string*>& fields,
39 unsigned int i = 0, bool clear=true) = 0;
40
41 static void cleanFieldPtrs(std::vector<std::string*>& fields);
42 /*
43 // Return specified row in results as a string
44 virtual bool getRowString(std::string& row, unsigned int iRow=0) const = 0;
45
46 Return vector of rows
47 @param rows to hold returned data
48 @param iRow starting row
49 @param maxRow maximum number of rows requested. 0 means "all"
50 @param clear if true, clear @a rows before storing new data
51 @return status
52
53 virtual bool getRowStrings(std::vector<std::string>& rows,
54 unsigned int iRow=0, unsigned int maxRow=0,
55 bool clear=true) const = 0;
56 */
57 };
58}
59#endif
static void cleanFieldPtrs(std::vector< std::string * > &fields)
Definition: ResultHandle.cxx:7
virtual bool getRow(std::vector< std::string > &fields, unsigned int i=0, bool clear=true)=0
virtual bool getRowPtrs(std::vector< std::string * > &fields, unsigned int i=0, bool clear=true)=0
virtual unsigned int getNRows() const =0
Return number of rows in results.
virtual bool getRowCon(char *par, unsigned long *treesize, unsigned int *runFrm, unsigned int *runTo, unsigned int i=0, bool clear=true)=0