-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy pathProcFileElements.h
69 lines (50 loc) · 2.17 KB
/
ProcFileElements.h
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
/// \file
/// \ingroup tutorial_ProcFileElements
///
/// Class to hold information about the processed elements of a file
///
/// \macro_code
///
/// \author Gerardo Ganis (gerardo.ganis@cern.ch)
#ifndef ROOT_ProcFileElements
#define ROOT_ProcFileElements
#include "TObject.h"
#include "TSortedList.h"
class ProcFileElements : public TObject {
public:
class ProcFileElement : public TObject {
public:
Long64_t fFirst; // Lower bound of this range
Long64_t fLast; // Upper bound of this range
ProcFileElement(Long64_t fst = 0, Long64_t lst = -1) :
fFirst(fst), fLast(lst) { }
~ProcFileElement() override { }
Int_t Compare(const TObject *obj) const override;
Bool_t IsSortable() const override { return kTRUE; }
Int_t MergeElement(ProcFileElement *);
Int_t Overlapping(ProcFileElement *);
void Print(Option_t *option="") const override;
ClassDefOverride(ProcFileElement, 1); // ProcFileElement class
};
private:
TString fName; // File name
TSortedList *fElements; // List of processed elements
Long64_t fFirst; // Overall lower bound
Long64_t fLast; // Overall Upper bound
public:
ProcFileElements(const char *fn = "") : fName(fn), fElements(nullptr),
fFirst(0), fLast(-1) { }
~ProcFileElements() override { if (fElements) { fElements->SetOwner();
delete fElements; } }
const char * GetName() const override { return fName; }
ULong_t Hash() const override { return fName.Hash(); }
Int_t Add(Long64_t fst = 0, Long64_t lst = -1);
Int_t Merge(TCollection *list);
TSortedList *GetListOfElements() const { return fElements; }
Int_t GetNumElements() const { return (fElements ? fElements->GetSize() : 0); }
Long64_t GetFirst() const { return fFirst; }
Long64_t GetLast() const { return fLast; }
void Print(Option_t *option="") const override;
ClassDefOverride(ProcFileElements, 1); // Processed File Elements class
};
#endif