This file is indexed.

/usr/include/root/TGenericTable.h is in libroot-misc-table-dev 5.34.14-1build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// @(#)root/table:$Id$
// Author: Valery Fine(fine@bnl.gov)   30/06/2001

#ifndef ROOT_TGenericTable
#define ROOT_TGenericTable

#include "TTable.h"

//////////////////////////////////////////////////////////////////////////
//                                                                      //
//  TGenericTable                                                       //
//                                                                      //
//  This is the class to represent the array of C-struct                //
//  defined at run-time                                                 //
//                                                                      //
//////////////////////////////////////////////////////////////////////////
class TGenericTable : public TTable {
protected:                                        
   TTableDescriptor *fColDescriptors;     
   virtual TTableDescriptor *GetDescriptorPointer() const { return fColDescriptors;}                 
   virtual void SetDescriptorPointer(TTableDescriptor *list) { fColDescriptors = list;}        
   void SetGenericType(){ TTable::SetType(GetDescriptorPointer()->GetName()); }
 
public:
   class iterator {
   protected:
      UInt_t  fRowSize;
      char   *fCurrentRow;
      iterator():  fRowSize(0), fCurrentRow(0) {}
   public:
      iterator(UInt_t size, char &rowPtr): fRowSize(size), fCurrentRow(&rowPtr){}
      iterator(const TTable &t, char &rowPtr): fRowSize(t.GetRowSize()), fCurrentRow(&rowPtr){}
      iterator(const TTable &t): fRowSize(t.GetRowSize()), fCurrentRow(0){}
      iterator(const iterator& iter) : fRowSize (iter.fRowSize), fCurrentRow(iter.fCurrentRow){}
      iterator &operator=(const iterator& iter) { fRowSize = iter.fRowSize; fCurrentRow = iter.fCurrentRow; return *this;}
      iterator &operator++()    { if (fCurrentRow) fCurrentRow+=fRowSize; return *this;}
      void     operator++(int) { if (fCurrentRow) fCurrentRow+=fRowSize;}
      iterator &operator--()    { if (fCurrentRow) fCurrentRow-=fRowSize; return *this;}
      void      operator--(int) { if (fCurrentRow) fCurrentRow-=fRowSize;}
      iterator &operator+(Int_t idx) { if (fCurrentRow) fCurrentRow+=idx*fRowSize; return *this;}
      iterator &operator-(Int_t idx) { if (fCurrentRow) fCurrentRow-=idx*fRowSize; return *this;}
      Int_t operator-(const iterator &it) const { return (fCurrentRow-it.fCurrentRow)/fRowSize; }
             char *operator *(){ return fCurrentRow;}
             Bool_t operator==(const iterator &t) const { return (fCurrentRow == t.fCurrentRow); }
      Bool_t operator!=(const iterator &t) const { return !operator==(t); }
   };                                        
   TGenericTable() : TTable("TGenericTable",-1), fColDescriptors(0) {SetType("generic");}      

   // Create TGenericTable by C structure name provided
   TGenericTable(const char *structName, const char *name);
   TGenericTable(const char *structName, Int_t n);
   TGenericTable(const char *structName, const char *name,Int_t n);

   // Create TGenericTable by TTableDescriptor pointer
   TGenericTable(const TTableDescriptor &dsc, const char *name);
   TGenericTable(const TTableDescriptor &dsc, Int_t n);
   TGenericTable(const TTableDescriptor &dsc,const char *name,Int_t n);

   virtual ~TGenericTable();

   char  *GetTable(Int_t i=0)   const { return ((char *)GetArray())+i*GetRowSize();}     
   TTableDescriptor  *GetTableDescriptors() const { return GetDescriptorPointer();}
   TTableDescriptor  *GetRowDescriptors()   const { return GetDescriptorPointer();}
   char &operator[](Int_t i){ assert(i>=0 && i < GetNRows()); return *GetTable(i); }             
   const char &operator[](Int_t i) const { assert(i>=0 && i < GetNRows()); return *((const char *)(GetTable(i))); } 
   iterator begin()        { return ((const TGenericTable *)this)->begin();}
   iterator begin() const  {                      return GetNRows() ? iterator(*this, *GetTable(0)):end();}
   iterator end()   { return ((const TGenericTable *)this)->end(); }
   iterator end()   const  {Long_t i = GetNRows(); return i? iterator(*this, *GetTable(i)):iterator(*this);}
   ClassDef(TGenericTable,4) // Generic array of C-structure (a'la STL vector)
};
 
#endif