Logo ROOT  
Reference Guide
TPgSQLRow.h
Go to the documentation of this file.
1 // @(#)root/pgsql:$Id$
2 // Author: g.p.ciceri <gp.ciceri@acm.org> 01/06/2001
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2001, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TPgSQLRow
13 #define ROOT_TPgSQLRow
14 
15 #include "TSQLRow.h"
16 
17 #include <libpq-fe.h>
18 
19 class TPgSQLRow : public TSQLRow {
20 
21 private:
22  PGresult *fResult{nullptr}; // current result set
23  ULong_t fRowNum{0}; // row number
24 
25  Bool_t IsValid(Int_t field);
26 
27 public:
28  TPgSQLRow(void *result, ULong_t rowHandle);
30 
31  void Close(Option_t *opt="") final;
32  ULong_t GetFieldLength(Int_t field) final;
33  const char *GetField(Int_t field) final;
34 
35  ClassDefOverride(TPgSQLRow,0) // One row of PgSQL query result
36 };
37 
38 #endif
TPgSQLRow::GetField
const char * GetField(Int_t field) final
Get specified field from row (0 <= field < GetFieldCount()).
Definition: TPgSQLRow.cxx:80
TPgSQLRow::IsValid
Bool_t IsValid(Int_t field)
Check if row is open and field index within range.
Definition: TPgSQLRow.cxx:50
TPgSQLRow::fRowNum
ULong_t fRowNum
Definition: TPgSQLRow.h:29
TPgSQLRow::fResult
PGresult * fResult
Definition: TPgSQLRow.h:28
TPgSQLRow::Close
void Close(Option_t *opt="") final
Close row.
Definition: TPgSQLRow.cxx:38
ClassDefOverride
#define ClassDefOverride(name, id)
Definition: Rtypes.h:329
TPgSQLRow
Definition: TPgSQLRow.h:19
bool
TPgSQLRow::~TPgSQLRow
~TPgSQLRow()
Destroy row object.
Definition: TPgSQLRow.cxx:29
TPgSQLRow::TPgSQLRow
TPgSQLRow(void *result, ULong_t rowHandle)
Single row of query result.
Definition: TPgSQLRow.cxx:20
TPgSQLRow::GetFieldLength
ULong_t GetFieldLength(Int_t field) final
Get length in bytes of specified field.
Definition: TPgSQLRow.cxx:62
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
TSQLRow
Definition: TSQLRow.h:30
TSQLRow.h
ULong_t
unsigned long ULong_t
Definition: RtypesCore.h:55
int