29#ifndef ROOT_TMVA_Option
30#define ROOT_TMVA_Option
74 virtual void Print( std::ostream&,
Int_t levelofdetail=0 )
const = 0;
116 void Print ( std::ostream&,
Int_t levelofdetail=0 )
const override;
140 std::stringstream str;
141 str << std::scientific <<
Value(i);
149 void Print( std::ostream&,
Int_t levelofdetail=0 )
const override;
176 std::stringstream str;
177 str << std::scientific << this->
Value();
183 return Value() ?
"True" :
"False";
188 return Value(i) ?
"True" :
"False";
196 std::stringstream str(val.
Data());
207 typename std::vector<T>::const_iterator predefIt;
209 for (;predefIt!=
fPreDefs.end(); predefIt++)
210 if ( (*predefIt)==val )
return kTRUE;
223 std::vector<TString>::const_iterator predefIt;
225 for (;predefIt!=
fPreDefs.end(); predefIt++) {
228 if (s==tVal) { foundPreDef =
kTRUE;
break; }
245 Log() << kFATAL <<
"<AddPreDefVal> predefined values for Option<Bool_t> don't make sense"
253 Log() << kFATAL <<
"<AddPreDefVal> predefined values for Option<Float_t> don't make sense"
273 os <<
" " << this->
TheName() <<
"[" << i <<
"]: " <<
"\"" << this->
GetValue(i) <<
"\"";
274 if (i!=
fSize-1) os << std::endl;
285 os << std::endl <<
"PreDefined - possible values are:" << std::endl;
286 typename std::vector<T>::const_iterator predefIt;
288 for (;predefIt!=
fPreDefs.end(); predefIt++) {
290 os <<
" - " << (*predefIt) << std::endl;
301 std::stringstream str(val.
Data());
316 std::stringstream str(val.
Data());
328 std::vector<TString>::const_iterator predefIt;
330 for (;predefIt!=
fPreDefs.end(); predefIt++) {
333 if (s==tVal) { valToSet = *predefIt;
break; }
337 std::stringstream str(valToSet.
Data());
347 if (valToSet==
"1" || valToSet==
"true" || valToSet==
"ktrue" || valToSet==
"t") {
348 this->
Value() =
true;
350 else if (valToSet==
"0" || valToSet==
"false" || valToSet==
"kfalse" || valToSet==
"f") {
351 this->
Value() =
false;
354 Log() << kFATAL <<
"<SetValueLocal> value \'" << val
355 <<
"\' can not be interpreted as boolean" <<
Endl;
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Signed integer 4 bytes (int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
float Float_t
Float 4 bytes (float).
#define ClassDefOverride(name, id)
ostringstream derivative to redirect and format output
virtual const char * TheName() const
const char * GetName() const override
Returns name of object.
OptionBase(const TString &name, const TString &desc)
constructor
virtual Bool_t SetValue(const TString &vs, Int_t i=-1)
set value for option
virtual Bool_t IsPreDefinedVal(const TString &) const =0
virtual Bool_t IsArrayOpt() const =0
const TString fDescription
virtual void SetValueLocal(const TString &vs, Int_t i=-1)=0
virtual Bool_t HasPreDefinedVal() const =0
const TString & Description() const
virtual Int_t GetArraySize() const =0
virtual void Print(std::ostream &, Int_t levelofdetail=0) const =0
friend class Configurable
virtual TString GetValue(Int_t i=-1) const =0
Option(T *&ref, Int_t size, const TString &name, const TString &desc)
Int_t GetArraySize() const override
Bool_t IsArrayOpt() const override
TString GetValue(Int_t i) const override
const T & Value(Int_t i) const override
virtual void PrintPreDefs(std::ostream &, Int_t levelofdetail=0) const
Bool_t IsArrayOpt() const override
TString GetValue(Int_t i=-1) const override
void Print(std::ostream &, Int_t levelofdetail=0) const override
std::vector< T > fPreDefs
virtual void AddPreDefVal(const T &)
Option(T &ref, const TString &name, const TString &desc)
void SetValueLocal(const TString &val, Int_t i=-1) override
Int_t GetArraySize() const override
virtual const T & Value(Int_t i=-1) const
Bool_t IsPreDefinedVal(const TString &) const override
virtual Bool_t IsPreDefinedValLocal(const T &) const
Bool_t HasPreDefinedVal() const override
virtual void Print(Option_t *option="") const
This method must be overridden when a class wants to print itself.
TObject()
TObject constructor.
void ToLower()
Change string to lower-case.
const char * Data() const
create variable transformations
MsgLogger & Endl(MsgLogger &ml)