Logo ROOT   6.18/05
Reference Guide
ProcFileElements.h
Go to the documentation of this file.
1/// \file
2/// \ingroup tutorial_ProcFileElements
3///
4/// Class to hold information about the processed elements of a file
5///
6/// \macro_code
7///
8/// \author Gerardo Ganis (gerardo.ganis@cern.ch)
9
10
11#ifndef ROOT_ProcFileElements
12#define ROOT_ProcFileElements
13
14
15#include "TObject.h"
16#include "TSortedList.h"
17
18class ProcFileElements : public TObject {
19
20public:
21 class ProcFileElement : public TObject {
22 public:
23 Long64_t fFirst; // Lower bound of this range
24 Long64_t fLast; // Upper bound of this range
25 ProcFileElement(Long64_t fst = 0, Long64_t lst = -1) :
26 fFirst(fst), fLast(lst) { }
27 virtual ~ProcFileElement() { }
28
29 Int_t Compare(const TObject *obj) const;
30
31 Bool_t IsSortable() const { return kTRUE; }
32 Int_t MergeElement(ProcFileElement *);
33
34 Int_t Overlapping(ProcFileElement *);
35 void Print(Option_t *option="") const;
36
37 ClassDef(ProcFileElement, 1); // ProcFileElement class
38 };
39
40private:
41 TString fName; // File name
42 TSortedList *fElements; // List of processed elements
43
44 Long64_t fFirst; // Overall lower bound
45 Long64_t fLast; // Overall Upper bound
46
47public:
48 ProcFileElements(const char *fn = "") : fName(fn), fElements(0),
49 fFirst(0), fLast(-1) { }
50 virtual ~ProcFileElements() { if (fElements) { fElements->SetOwner();
51 delete fElements; } }
52 const char * GetName() const { return fName; }
53 ULong_t Hash() const { return fName.Hash(); }
54
55 Int_t Add(Long64_t fst = 0, Long64_t lst = -1);
56 Int_t Merge(TCollection *list);
57
58 TSortedList *GetListOfElements() const { return fElements; }
59 Int_t GetNumElements() const { return (fElements ? fElements->GetSize() : 0); }
60
61 Long64_t GetFirst() const { return fFirst; }
62 Long64_t GetLast() const { return fLast; }
63
64 void Print(Option_t *option="") const;
65
66 ClassDef(ProcFileElements, 1); // Processed File Elements class
67};
68
69#endif
int Int_t
Definition: RtypesCore.h:41
unsigned long ULong_t
Definition: RtypesCore.h:51
bool Bool_t
Definition: RtypesCore.h:59
long long Long64_t
Definition: RtypesCore.h:69
const Bool_t kTRUE
Definition: RtypesCore.h:87
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:326
Int_t Compare(const void *item1, const void *item2)
T1 fFirst
Definition: X11Events.mm:86
Collection abstract base class.
Definition: TCollection.h:63
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Definition: TCollection.h:182
Mother of all ROOT objects.
Definition: TObject.h:37
virtual const char * GetName() const
Returns name of object.
Definition: TObject.cxx:357
virtual void Print(Option_t *option="") const
This method must be overridden when a class wants to print itself.
Definition: TObject.cxx:550
virtual ULong_t Hash() const
Return hash value for this object.
Definition: TObject.cxx:433
A sorted doubly linked list.
Definition: TSortedList.h:28
Basic string class.
Definition: TString.h:131
UInt_t Hash(ECaseCompare cmp=kExact) const
Return hash value.
Definition: TString.cxx:638
void Add(RHist< DIMENSIONS, PRECISION_TO, STAT_TO... > &to, const RHist< DIMENSIONS, PRECISION_FROM, STAT_FROM... > &from)
Add two histograms.
Definition: RHist.hxx:309
void Print(std::ostream &os, const OptionType &opt)