/usr/include/root/TTableMap.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 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | // @(#)root/table:$Id$
// Author: Valery Fine(fine@bnl.gov) 01/03/2001
/*************************************************************************
* Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. *
* Copyright (C) 2001 [BNL] Brookhaven National Laboratory. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_TTableMap
#define ROOT_TTableMap
#include "assert.h"
#include <vector>
#ifndef ROOT_TTable
#include "TTable.h"
#endif
//////////////////////////////////////////////////////
//
// Class TTableMap
// Iterator of the table with extra index array
//
//////////////////////////////////////////////////////
class TTableMap : public TObject
#ifndef __CINT__
, public std::vector<Long_t>
#endif
{
private:
TTableMap &operator=(const TTableMap &orig); // intentionally not implemented.
protected:
const TTable *fTable; // pointer to the refered TTable
public:
TTableMap(const TTable *table=0);
TTableMap(const TTableMap &map) : TObject(map)
#ifndef __CINT__
, std::vector<Long_t>(map)
#endif
, fTable(map.fTable) {;}
virtual ~TTableMap(){;}
Bool_t IsValid() const;
Bool_t IsFolder() const;
void Push_back(Long_t next); // workaround for Cint
const TTable *Table(){return fTable;}
TTable::iterator Begin();
TTable::iterator Begin() const;
TTable::iterator End();
TTable::iterator End() const;
ClassDef(TTableMap,1) // "Map" array for TTable object
};
//___________________________________________________________________________________________________________
inline Bool_t TTableMap::IsValid() const
{
// Check whether all "map" values do belong the table
TTable::iterator i = Begin();
TTable::iterator finish = End();
Int_t totalSize = fTable->GetNRows();
for (; i != finish; i++) {
Long_t th = *i;
if ( th == -1 || (0 <= th && th < totalSize) ) continue;
return kFALSE;
}
return kTRUE;
}
//___________________________________________________________________________________________________________
inline TTable::iterator TTableMap::Begin() { std::vector<Long_t>::iterator bMap = this->begin(); return TTable::iterator(*fTable, bMap);}
//___________________________________________________________________________________________________________
inline TTable::iterator TTableMap::Begin() const { std::vector<Long_t>::const_iterator bMap = this->begin(); return TTable::iterator(*fTable, bMap);}
//___________________________________________________________________________________________________________
inline TTable::iterator TTableMap::End() { std::vector<Long_t>::iterator eMap = this->end(); return TTable::iterator(*fTable, eMap);}
//___________________________________________________________________________________________________________
inline TTable::iterator TTableMap::End() const { std::vector<Long_t>::const_iterator eMap = this->end(); return TTable::iterator(*fTable, eMap);}
//___________________________________________________________________________________________________________
inline Bool_t TTableMap::IsFolder() const { return kTRUE;}
//___________________________________________________________________________________________________________
inline void TTableMap::Push_back(Long_t next){ push_back(next); } // workaround for Cint
#endif
|