Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TTreeRow.h
Go to the documentation of this file.
1// @(#)root/tree:$Id$
2// Author: Fons Rademakers 30/11/99
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, 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_TTreeRow
13#define ROOT_TTreeRow
14
15
16//////////////////////////////////////////////////////////////////////////
17// //
18// TTreeRow //
19// //
20// Class defining interface to a row of a TTree query result. //
21// Objects of this class are created by TTreeResult methods. //
22// //
23// Related classes are TTreeResult. //
24// //
25//////////////////////////////////////////////////////////////////////////
26
27#include "TSQLRow.h"
28
29class TTreeRow : public TSQLRow {
30
31friend class TTreeResult;
32friend class TTreePlayer;
33
34private:
35 Int_t fColumnCount; ///< number of columns in row
36 Int_t *fFields; ///<[fColumnCount] index in fRow of the end of each field
37 char *fRow; ///< string with all the fColumnCount fields
38 TTreeRow *fOriginal; ///<! pointer to original row
39
40 TTreeRow(TSQLRow *original);
41 bool IsValid(Int_t field);
42
43 TTreeRow(const TTreeRow&) = delete;
44 TTreeRow &operator=(const TTreeRow&) = delete;
45
46public:
47 TTreeRow();
48 TTreeRow(Int_t nfields);
49 TTreeRow(Int_t nfields, const Int_t *fields, const char *row);
50 ~TTreeRow() override;
51
52 void Close(Option_t *option="") override;
53 ULong_t GetFieldLength(Int_t field) override;
54 const char *GetField(Int_t field) override;
55 void SetRow(const Int_t *fields, const char *row);
56
57 ClassDefOverride(TTreeRow,1) // One row of a TTree query result
58};
59
60#endif
unsigned long ULong_t
Definition RtypesCore.h:55
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t option
Implement some of the functionality of the class TTree requiring access to extra libraries (Histogram...
Definition TTreePlayer.h:37
Class defining interface to a TTree query result with the same interface as for SQL databases.
Definition TTreeResult.h:34
Class defining interface to a row of a TTree query result.
Definition TTreeRow.h:29
Int_t fColumnCount
number of columns in row
Definition TTreeRow.h:35
TTreeRow & operator=(const TTreeRow &)=delete
~TTreeRow() override
Destroy row object.
Definition TTreeRow.cxx:89
ULong_t GetFieldLength(Int_t field) override
Get length in bytes of specified field.
Definition TTreeRow.cxx:127
Int_t * fFields
[fColumnCount] index in fRow of the end of each field
Definition TTreeRow.h:36
const char * GetField(Int_t field) override
Get specified field from row (0 <= field < GetFieldCount()).
Definition TTreeRow.cxx:142
void SetRow(const Int_t *fields, const char *row)
The field and row information.
Definition TTreeRow.cxx:157
TTreeRow * fOriginal
! pointer to original row
Definition TTreeRow.h:38
bool IsValid(Int_t field)
Check if row is open and field index within range.
Definition TTreeRow.cxx:111
char * fRow
string with all the fColumnCount fields
Definition TTreeRow.h:37
TTreeRow()
Single row of a query result.
Definition TTreeRow.cxx:29
void Close(Option_t *option="") override
Close row.
Definition TTreeRow.cxx:98
TTreeRow(const TTreeRow &)=delete