Logo ROOT   6.07/09
Reference Guide
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 #ifndef ROOT_TSQLRow
28 #include "TSQLRow.h"
29 #endif
30 
31 class TTreeRow : public TSQLRow {
32 
33 friend class TTreeResult;
34 friend class TTreePlayer;
35 
36 private:
37  Int_t fColumnCount; ///< number of columns in row
38  Int_t *fFields; ///<[fColumnCount] index in fRow of the end of each field
39  char *fRow; ///< string with all the fColumnCount fields
40  TTreeRow *fOriginal; ///<! pointer to original row
41 
42  TTreeRow(TSQLRow *original);
43  Bool_t IsValid(Int_t field);
44 
45  TTreeRow(const TTreeRow&); // Not implemented.
46  TTreeRow &operator=(const TTreeRow&); // Not implemented.
47 
48 public:
49  TTreeRow();
50  TTreeRow(Int_t nfields);
51  TTreeRow(Int_t nfields, const Int_t *fields, const char *row);
52  virtual ~TTreeRow();
53 
54  void Close(Option_t *option="");
56  const char *GetField(Int_t field);
57  void SetRow(const Int_t *fields, const char *row);
58 
59  ClassDef(TTreeRow,1) // One row of an TTree query result
60 };
61 
62 #endif
const char Option_t
Definition: RtypesCore.h:62
void SetRow(const Int_t *fields, const char *row)
The field and row information.
Definition: TTreeRow.cxx:156
TTreeRow & operator=(const TTreeRow &)
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const char * GetField(Int_t field)
Get specified field from row (0 <= field < GetFieldCount()).
Definition: TTreeRow.cxx:141
Class defining interface to a row of a TTree query result.
Definition: TTreeRow.h:31
#define ClassDef(name, id)
Definition: Rtypes.h:254
void Close(Option_t *option="")
Close row.
Definition: TTreeRow.cxx:99
Bool_t IsValid(Int_t field)
Check if row is open and field index within range.
Definition: TTreeRow.cxx:110
ULong_t GetFieldLength(Int_t field)
Get length in bytes of specified field.
Definition: TTreeRow.cxx:126
TTreeRow()
Single row of a query result.
Definition: TTreeRow.cxx:30
virtual ~TTreeRow()
Destroy row object.
Definition: TTreeRow.cxx:90
Class defining interface to a TTree query result with the same interface as for SQL databases...
Definition: TTreeResult.h:36
Int_t * fFields
[fColumnCount] index in fRow of the end of each field
Definition: TTreeRow.h:38
Int_t fColumnCount
number of columns in row
Definition: TTreeRow.h:37
unsigned long ULong_t
Definition: RtypesCore.h:51
char * fRow
string with all the fColumnCount fields
Definition: TTreeRow.h:39
TTreeRow * fOriginal
! pointer to original row
Definition: TTreeRow.h:40
Implement some of the functionality of the class TTree requiring access to extra libraries (Histogram...
Definition: TTreePlayer.h:43