200 const char* argName3,
const char* argName4,
201 const char* argName5,
const char* argName6,
202 const char* argName7,
const char* argName8)
296 void RooCmdConfig::defineMutex(
const char* argName1,
const char* argName2,
const char* argName3,
const char* argName4,
const char* argName5)
319 coutE(
InputArguments) <<
"RooCmdConfig::defintInt: name '" << name <<
"' already defined" << endl ;
341 coutE(
InputArguments) <<
"RooCmdConfig::defineDouble: name '" << name <<
"' already defined" << endl ;
365 coutE(
InputArguments) <<
"RooCmdConfig::defineString: name '" << name <<
"' already defined" << endl ;
391 coutE(
InputArguments) <<
"RooCmdConfig::defineObject: name '" << name <<
"' already defined" << endl ;
416 coutE(
InputArguments) <<
"RooCmdConfig::defineObject: name '" << name <<
"' already defined" << endl ;
440 cout << ri->
GetName() <<
"[Int_t] = " << *ri << endl ;
447 cout << rd->
GetName() <<
"[Double_t] = " << *rd << endl ;
454 cout << rs->
GetName() <<
"[string] = \"" << rs->
getVal() <<
"\"" << endl ;
461 cout << ro->
GetName() <<
"[TObject] = " ;
466 cout <<
"(null)" << endl ;
516 const char* opc = arg.
opcode() ;
535 cout <<
"RooCmdConfig::process: " << opc <<
" has unprocessed dependent " << dep->
GetTitle()
536 <<
", adding to required list" << endl ;
540 cout <<
"RooCmdConfig::process: " << opc <<
" dependent " << dep->
GetTitle() <<
" is already processed" << endl ;
549 cout <<
"RooCmdConfig::process: " << opc <<
" excludes " << mutex->
GetTitle()
550 <<
", adding to forbidden list" << endl ;
566 cout <<
"RooCmdConfig::process " << ri->
GetName() <<
"[Int_t]" <<
" set to " << *ri << endl ;
579 cout <<
"RooCmdConfig::process " << rd->
GetName() <<
"[Double_t]" <<
" set to " << *rd << endl ;
590 const char* oldStr = rs->
getVal() ;
592 if (oldStr && strlen(oldStr)>0 && rs->
getAttribute(
"RooCmdConfig::AppendMode")) {
599 cout <<
"RooCmdConfig::process " << rs->
GetName() <<
"[string]" <<
" set to " << rs->
getVal() << endl ;
612 cout <<
"RooCmdConfig::process " << os->
GetName() <<
"[TObject]" <<
" set to " ;
616 cout <<
"(null)" << endl ;
630 cout <<
"RooCmdConfig::process " << cs->
GetName() <<
"[RooArgSet]" <<
" set to " ;
634 cout <<
"(null)" << endl ;
661 if (strlen(subArg->
GetName())>0) {
666 depRet |=
process(subArgCopy) ;
693 return ri ? (
Int_t)(*ri) : defVal ;
705 return rd ? (
Double_t)(*rd) : defVal ;
718 return rs ? ((convEmptyToNull && strlen(rs->
getVal())==0) ? 0 : ((
const char*)rs->
getVal()) ) : defVal ;
730 return ro ? ro->
obj() : defVal ;
753 return ro ? ro->
objList() : defaultDummy ;
784 if (!cmdsToPurge)
return ;
788 strlcpy(buf,cmdsToPurge,1024) ;
790 char*
name = strtok(buf,
",") ;
793 if (cmd) cmdList.
Remove(cmd) ;
794 name = strtok(0,
",") ;
808 if (!cmdNameList)
return filterList ;
812 strlcpy(buf,cmdNameList,1024) ;
814 char*
name = strtok(buf,
",") ;
818 if (removeFromInList) {
821 filterList.
Add(cmd) ;
823 name = strtok(0,
",") ;
841 pc.
defineInt(
"theInt",cmdArgName,intIdx,defVal) ;
845 return pc.
getInt(
"theInt") ;
859 static string retBuf =
"" ;
874 return retBuf.c_str() ;
void setAttribute(const Text_t *name, Bool_t value=kTRUE)
Set (default) or clear a named boolean attribute of this object.
virtual const char * GetTitle() const
Returns title of object.
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
Bool_t hasProcessed(const char *cmdName) const
Return true if RooCmdArg with name 'cmdName' has been processed.
RooCmdConfig(const char *methodName)
Constructor taking descriptive name of owner/user which is used as prefix for any warning or error me...
Bool_t defineDouble(const char *name, const char *argName, Int_t doubleNum, Double_t defValue=0.)
Define Double_t property name 'name' mapped to Double_t in slot 'doubleNum' in RooCmdArg with name ar...
Collectable string class.
virtual Bool_t Remove(TObject *arg)
Remove object from collection.
static const char * decodeStringOnTheFly(const char *callerID, const char *cmdArgName, Int_t intIdx, const char *defVal, const RooCmdArg &arg1, const RooCmdArg &arg2=RooCmdArg(), const RooCmdArg &arg3=RooCmdArg(), const RooCmdArg &arg4=RooCmdArg(), const RooCmdArg &arg5=RooCmdArg(), const RooCmdArg &arg6=RooCmdArg(), const RooCmdArg &arg7=RooCmdArg(), const RooCmdArg &arg8=RooCmdArg(), const RooCmdArg &arg9=RooCmdArg())
Static decoder function allows to retrieve string property from set of RooCmdArgs For use in base mem...
const char * getString(const char *name, const char *defaultValue="", Bool_t convEmptyToNull=kFALSE)
Return string property registered with name 'name'.
virtual void SetName(const char *name)
Change (i.e.
virtual void setVal(const char *newVal)
Set value to given TString.
void defineRequiredArgs(const char *argName1, const char *argName2=0, const char *argName3=0, const char *argName4=0, const char *argName5=0, const char *argName6=0, const char *argName7=0, const char *argName8=0)
Add condition that any of listed arguments must be processed for parsing to be declared successful...
const char * opcode() const
const char * getString(Int_t idx) const
Bool_t defineSet(const char *name, const char *argName, Int_t setNum, const RooArgSet *set=0)
Define TObject property name 'name' mapped to object in slot 'setNum' in RooCmdArg with name argName ...
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
void allowUndefined(Bool_t flag=kTRUE)
TObject * getObject(const char *name, TObject *obj=0)
Return TObject property registered with name 'name'.
Bool_t getAttribute(const Text_t *name) const
Check if a named attribute is set. By default, all attributes are unset.
Iterator abstract base class.
Double_t getDouble(Int_t idx) const
~RooCmdConfig()
Destructor.
void setObj(TObject *inObj)
const char * Data() const
Bool_t process(const RooCmdArg &arg)
Process given RooCmdArg.
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
const char * missingArgs() const
Return string with names of arguments that were required, but not processed.
The TNamed class is the base class for all named ROOT classes.
std::map< std::string, std::string >::const_iterator iter
Bool_t defineString(const char *name, const char *argName, Int_t stringNum, const char *defValue="", Bool_t appendMode=kFALSE)
Define Double_t property name 'name' mapped to Double_t in slot 'stringNum' in RooCmdArg with name ar...
TString & Append(const char *cs)
Int_t getInt(Int_t idx) const
TIterator * MakeIterator(Bool_t dir=kTRUE) const
Return an iterator over this list.
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
void defineDependency(const char *refArgName, const char *neededArgName)
Define that processing argument name refArgName requires processing of argument named neededArgName t...
Bool_t defineInt(const char *name, const char *argName, Int_t intNum, Int_t defValue=0)
Define integer property name 'name' mapped to integer in slot 'intNum' in RooCmdArg with name argName...
void stripCmdList(RooLinkedList &cmdList, const char *cmdsToPurge)
Utility function that strips command names listed (comma separated) in cmdsToPurge from cmdList...
virtual void SetUniqueID(UInt_t uid)
Set the unique object id.
virtual void Add(TObject *arg)
void defineMutex(const char *argName1, const char *argName2)
Define arguments named argName1 and argName2 mutually exclusive.
Int_t getInt(const char *name, Int_t defaultValue=0)
Return integer property registered with name 'name'.
static TObject * decodeObjOnTheFly(const char *callerID, const char *cmdArgName, Int_t objIdx, TObject *defVal, const RooCmdArg &arg1, const RooCmdArg &arg2=RooCmdArg(), const RooCmdArg &arg3=RooCmdArg(), const RooCmdArg &arg4=RooCmdArg(), const RooCmdArg &arg5=RooCmdArg(), const RooCmdArg &arg6=RooCmdArg(), const RooCmdArg &arg7=RooCmdArg(), const RooCmdArg &arg8=RooCmdArg(), const RooCmdArg &arg9=RooCmdArg())
Static decoder function allows to retrieve object property from set of RooCmdArgs For use in base mem...
virtual TObject * Remove(TObject *obj)
Remove object from the list.
char * Form(const char *fmt,...)
virtual const char * GetName() const
Returns name of object.
TObject * FindObject(const char *name) const
Return pointer to obejct with given name.
Bool_t ok(Bool_t verbose) const
Return true of parsing was successful.
static Int_t decodeIntOnTheFly(const char *callerID, const char *cmdArgName, Int_t intIdx, Int_t defVal, const RooCmdArg &arg1, const RooCmdArg &arg2=RooCmdArg(), const RooCmdArg &arg3=RooCmdArg(), const RooCmdArg &arg4=RooCmdArg(), const RooCmdArg &arg5=RooCmdArg(), const RooCmdArg &arg6=RooCmdArg(), const RooCmdArg &arg7=RooCmdArg(), const RooCmdArg &arg8=RooCmdArg(), const RooCmdArg &arg9=RooCmdArg())
Static decoder function allows to retrieve integer property from set of RooCmdArgs For use in base me...
virtual const char * getVal() const
Return value of object. Calculated if dirty, otherwise cached value is returned.
RooArgSet * getSet(const char *name, RooArgSet *set=0)
Return RooArgSet property registered with name 'name'.
virtual Int_t GetSize() const
virtual const char * GetName() const
Returns name of object.
virtual TObject * Clone(const char *newname=0) const
Make a clone of an object using the Streamer facility.
Double_t getDouble(const char *name, Double_t defaultValue=0)
Return Double_t property registered with name 'name'.
const TObject * getObject(Int_t idx) const
TObject * At(Int_t index) const
Return object stored in sequential position given by index.
void print()
Print configuration of parser.
const RooLinkedList & getObjectList(const char *name)
Return list of objects registered with name 'name'.
virtual UInt_t GetUniqueID() const
Return the unique object id.
Mother of all ROOT objects.
const RooArgSet * getSet(Int_t idx) const
Return RooArgSet stored in slot idx.
virtual void Add(TObject *obj)
virtual TObject * Next()=0
virtual TIterator * MakeIterator(Bool_t dir=kIterForward) const
Return a list iterator.
Bool_t defineObject(const char *name, const char *argName, Int_t setNum, const TObject *obj=0, Bool_t isArray=kFALSE)
Define TObject property name 'name' mapped to object in slot 'setNum' in RooCmdArg with name argName ...
const RooLinkedList & objList() const
virtual const char * GetTitle() const
Returns title of object.
virtual void SetTitle(const char *title="")
Change (i.e. set) the title of the TNamed.
RooLinkedList filterCmdList(RooLinkedList &cmdInList, const char *cmdNameList, Bool_t removeFromInList=kTRUE)
Utility function to filter commands listed in cmdNameList from cmdInList.
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.