#include "TProofDebug.h"
#include "TProofMonSender.h"
Int_t TProofMonSender::SetSendOptions(const char *sendopts)
{
if (sendopts && strlen(sendopts) > 0) {
PDB(kMonitoring,1) Info("SetSendOptions", "sendopts: '%s'", sendopts);
Bool_t doit = kTRUE;
Char_t t = 0;
Int_t v = -1;
TString oos(sendopts), oo;
Ssiz_t from = 0;
while (oos.Tokenize(oo, from, ":")) {
PDB(kMonitoring,2) Info("SetSendOptions", "oo: '%s'", oo.Data());
doit = kTRUE;
if (oo.BeginsWith("+")) oo.Remove(0,1);
if (oo.BeginsWith("-")) { doit = kFALSE; oo.Remove(0,1); }
PDB(kMonitoring,2) Info("SetSendOptions", "oo: '%s' doit:%d", oo.Data(), doit);
t = oo[0];
oo.Remove(0,1);
PDB(kMonitoring,2) Info("SetSendOptions", "oo: '%s' doit:%d t:'%c'", oo.Data(), doit, t);
v = -1;
if (!oo.IsNull() && oo.IsDigit()) v = oo.Atoi();
PDB(kMonitoring,2) Info("SetSendOptions", "oo: '%s' doit:%d t:'%c' v:%d", oo.Data(), doit, t, v);
TProofMonSender::EConfigBits cbit = kSendSummary;
if (t == 'D') cbit = kSendDataSetInfo;
if (t == 'F') cbit = kSendFileInfo;
if (doit)
SetBit(cbit);
else
ResetBit(cbit);
if (v > -1) {
if (t == 'S') fSummaryVrs = v;
if (t == 'D') fDataSetInfoVrs = v;
if (t == 'F') fFileInfoVrs = v;
}
}
}
if (!(TestBit(kSendSummary) || TestBit(kSendDataSetInfo) || TestBit(kSendFileInfo))) {
Warning("SetSendOptions", "all tables are disabled!");
return -1;
}
TString snot = TString::Format("%s: sending:", GetTitle());
if (TestBit(kSendSummary)) snot += TString::Format(" 'summary' (v:%d)", fSummaryVrs);
if (TestBit(kSendDataSetInfo)) snot += TString::Format(" 'dataset info' (v:%d)", fDataSetInfoVrs);
if (TestBit(kSendFileInfo)) snot += TString::Format(" 'file info' (v:%d)", fFileInfoVrs);
Info("SetSendOptions", "%s", snot.Data());
return 0;
}