Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TProofOutputList.cxx
Go to the documentation of this file.
1// @(#)root/proofplayer:$Id$
2// Author: G. Ganis 04/08/2010
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/** \class TProofOutputList
13\ingroup proofkernel
14
15Derivation of TList with an overload of ls() and Print() allowing to filter
16out some of the variables
17
18*/
19
20#include "TObjString.h"
21#include "TProof.h"
22#include "TProofOutputList.h"
23#include "TRegexp.h"
24#include "TString.h"
25
27
28////////////////////////////////////////////////////////////////////////////////
29/// Constructor
30
32{
33 fDontShow = new TList();
34 TString regs(dontshow), reg;
35 Int_t from = 0;
36 while (regs.Tokenize(reg, from, ",")) {
38 }
39}
40
41////////////////////////////////////////////////////////////////////////////////
42/// Destructor
43
45{
48}
49
50////////////////////////////////////////////////////////////////////////////////
51/// Attach to list 'alist'
52
54{
55 if (!alist) return;
56
57 if (GetSize() > 0) Clear();
58
59 TIter nxo(alist);
60 TObject *obj = 0;
61 while ((obj = nxo())) { Add(obj); }
63}
64
65////////////////////////////////////////////////////////////////////////////////
66/// List the content of the list
67
69{
70 TString opt(option);
71 opt.ToUpper();
72 if (opt.BeginsWith("ALL")) {
73 opt.Remove(0,3);
74 TList::ls(opt);
75 } else {
76 TIter nxos(fDontShow);
77 TObjString *os = 0;
78 TList doShow;
79 doShow.SetOwner(kFALSE);
80
81 Bool_t hasmissing = kFALSE;
82 TIter nxo(this);
83 TObject *obj = 0;
84 while ((obj = nxo())) {
85 TString s = obj->GetName();
86 if (s == kPROOF_MissingFiles) {
87 TList *mf = dynamic_cast<TList *> (obj);
88 if (mf && mf->GetSize() > 0) hasmissing = kTRUE;
89 } else {
90 nxos.Reset();
91 Bool_t doadd = kTRUE;
92 while ((os = (TObjString *) nxos())) {
93 TRegexp rg(os->GetName(), kTRUE);
94 if (s.Index(rg) != kNPOS) {
95 doadd = kFALSE;
96 break;
97 }
98 }
99 if (doadd) doShow.Add(obj);
100 }
101 }
102 doShow.ls(option);
103 // Notify if missing files were found
104 if (hasmissing)
105 Printf(" +++ Missing files list not empty: use ShowMissingFiles to display it +++");
106 }
107 // Done
108 return;
109}
110
111
112////////////////////////////////////////////////////////////////////////////////
113/// Print the content of the list
114
116{
117 TString opt(option);
118 opt.ToUpper();
119 if (opt.BeginsWith("ALL")) {
120 opt.Remove(0,3);
121 TList::Print(opt);
122 } else {
123 TIter nxos(fDontShow);
124 TObjString *os = 0;
125 TList doShow;
126 doShow.SetOwner(kFALSE);
127
128 Bool_t hasmissing = kFALSE;
129 TIter nxo(this);
130 TObject *obj = 0;
131 while ((obj = nxo())) {
132 TString s = obj->GetName();
133 if (s == kPROOF_MissingFiles) {
134 TList *mf = dynamic_cast<TList *> (obj);
135 if (mf && mf->GetSize() > 0) hasmissing = kTRUE;
136 } else {
137 nxos.Reset();
138 Bool_t doadd = kTRUE;
139 while ((os = (TObjString *) nxos())) {
140 TRegexp rg(os->GetName());
141 if (s.Index(rg) != kNPOS) {;
142 doadd = kFALSE;
143 break;
144 }
145 }
146 if (doadd) doShow.Add(obj);
147 }
148 }
149 doShow.Print(option);
150 // Notify if missing files were found
151 if (hasmissing)
152 Printf(" +++ Missing files list not empty: use ShowMissingFiles to display it +++");
153 }
154 // Done
155 return;
156}
#define SafeDelete(p)
Definition RConfig.hxx:517
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
constexpr Ssiz_t kNPOS
Definition RtypesCore.h:124
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
const char Option_t
Definition RtypesCore.h:66
#define ClassImp(name)
Definition Rtypes.h:377
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void reg
const char *const kPROOF_MissingFiles
Definition TProof.h:137
void Printf(const char *fmt,...)
Formats a string in a circular formatting buffer and prints the string.
Definition TString.cxx:2503
void ls(Option_t *option="") const override
List (ls) all objects in this collection.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
void Print(Option_t *option="") const override
Default print for collections, calls Print(option, 1).
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
void Reset()
A doubly linked list.
Definition TList.h:38
void Clear(Option_t *option="") override
Remove all objects from the list.
Definition TList.cxx:400
void Add(TObject *obj) override
Definition TList.h:83
TList()
Definition TList.h:72
Collectable string class.
Definition TObjString.h:28
const char * GetName() const override
Returns name of object.
Definition TObjString.h:38
Mother of all ROOT objects.
Definition TObject.h:41
virtual const char * GetName() const
Returns name of object.
Definition TObject.cxx:439
virtual void Print(Option_t *option="") const
This method must be overridden when a class wants to print itself.
Definition TObject.cxx:636
virtual void ls(Option_t *option="") const
The ls function lists the contents of a class on stdout.
Definition TObject.cxx:574
Derivation of TList with an overload of ls() and Print() allowing to filter out some of the variables...
void ls(Option_t *option="") const override
List the content of the list.
void AttachList(TList *alist)
Attach to list 'alist'.
TProofOutputList(const char *dontshow="PROOF_*")
Constructor.
~TProofOutputList() override
Destructor.
void Print(Option_t *option="") const override
Print the content of the list.
Regular expression class.
Definition TRegexp.h:31
Basic string class.
Definition TString.h:139
void ToUpper()
Change string to upper case.
Definition TString.cxx:1195
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
Definition TString.h:623
TString & Remove(Ssiz_t pos)
Definition TString.h:685
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Definition TString.h:651