4 #ifndef __KVNAMEVALUELIST_H
5 #define __KVNAMEVALUELIST_H
7 #include "KVHashList.h"
10 #include "KVNamedParameter.h"
234 template<
typename value_type>
248 template <
typename value_type>
267 template <
typename value_type>
286 template <
typename value_type>
305 template <
typename value_type>
315 template <
typename value_type>
322 return (*par) == tmp;
331 template <
typename value_type>
337 return (
p &&
p->Is<value_type>());
347 return HasParameter<int>(
name);
351 return HasParameter<bool>(
name);
361 return HasParameter<double>(
name);
365 return HasParameter<TString>(
name);
396 throw std::runtime_error(
Form(
"KVNameValueList::operator[](const TString&): no parameter with name '%s' in list",
name.Data()));
399 template <
typename value_type>
407 return (par ? par->
Get<value_type>() : KVNamedParameter::DefaultValue<value_type>());
412 return GetValue<int>(
name);
416 return GetValue<bool>(
name);
420 return GetValue<double>(
name);
424 return GetValue<cstring>(
name);
428 template <
typename value_type>
435 return (par ? par->
Get<value_type>() : KVNamedParameter::DefaultValue<value_type>());
440 return GetValue<int>(idx);
444 return GetValue<bool>(idx);
448 return GetValue<double>(idx);
452 return GetValue<cstring>(idx);
#define ClassDef(name, id)
#define ClassDefOverride(name, id)
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
char * Form(const char *fmt,...)
Extension of TEnv to allow the writing of comments in the file.
Extended version of ROOT THashList.
void Sort(Bool_t order=kSortAscending)
std::forward_iterator_tag iterator_category
KVNamedParameter * pointer
Iterator(const Iterator &other)
KVNamedParameter & operator*() const
KVNamedParameter & reference
Iterator(const KVNameValueList *N)
Iterator(const KVNameValueList &N)
Bool_t operator==(const Iterator &it) const
Bool_t operator!=(const Iterator &it) const
const Iterator & operator++()
KVNamedParameter * current() const
Iterator & operator=(const Iterator &rhs)
std::ptrdiff_t difference_type
KVNamedParameter value_type
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
KVNamedParameter * GetParameter(Int_t idx) const
return the parameter object with index idx
void Copy(TObject &nvl) const override
Int_t GetIntValue(const Char_t *name) const
KVNameValueList & operator=(KVNameValueList &&)=default
Double_t GetDoubleValue(const Char_t *name) const
Bool_t HasValue64bit(const Char_t *name) const
void SetValue(const Char_t *name, value_type value)
std::unique_ptr< KVEnv > ProduceEnvFile()
Put all name-value pairs in this list as a TEnv format.
Bool_t HasNumericParameter(const Char_t *name) const
void RemoveParameter(const Char_t *name)
void SetValue64bit(const Char_t *name, ULong64_t)
void SetFromEnv(TEnv *tenv, const TString &prefix="")
void IncrementValue(const Char_t *name, value_type value)
const Char_t * GetNameAt(Int_t idx) const
void ls(Option_t *opt="") const override
Int_t GetNpar() const
return the number of stored parameters
Bool_t HasStringParameter(const Char_t *name) const
void ReadEnv(const TEnv &)
virtual void ClearSelection(const TRegexp &)
void SetFirstValue(const Char_t *name, value_type value)
virtual void ReadEnvFile(const Char_t *filename)
Bool_t IsValue(const Char_t *name, value_type value) const
TString List(Option_t *opt="") const
void SetValueAt(const Char_t *name, value_type value, Int_t idx)
void Concatenate(const KVNameValueList &nvl)
virtual void WriteEnvFile(const Char_t *filename)
Write all name-value pairs in this list as a TEnv format file.
Int_t GetNameIndex(const Char_t *name) const
void Merge(const KVNameValueList &)
KVNamedParameter * FindParameter(const Char_t *name) const
return the parameter object with the asking name
Int_t Compare(const TObject *nvl) const override
KVNameValueList & operator=(const KVNameValueList &)
KVHashList fList
list of KVNamedParameter objects
Bool_t HasIntParameter(const Char_t *name) const
void Sort(Bool_t order=kSortAscending)
value_type GetValue(Int_t idx) const
void Clear(Option_t *opt="") override
KVNamedParameter & operator[](const TString &name) const
Bool_t GetBoolValue(Int_t idx) const
Double_t GetDoubleValue(Int_t idx) const
void WriteClass(const Char_t *classname, const Char_t *classdesc, const Char_t *base_class="")
Bool_t HasBoolParameter(const Char_t *name) const
Bool_t GetBoolValue(const Char_t *name) const
ULong64_t GetValue64bit(const Char_t *name) const
value_type GetValue(const Char_t *name) const
const Char_t * GetStringValue(Int_t idx) const
Int_t GetIntValue(Int_t idx) const
const Char_t * GetStringValue(const Char_t *name) const
Bool_t HasParameter(const Char_t *name) const
TString AsSQLSelection() const
void SetLastValue(const Char_t *name, value_type value)
bool Set(const KVString &)
Bool_t HasDoubleParameter(const Char_t *name) const
Bool_t HasParameter(const Char_t *name) const
void Print(Option_t *opt="") const override
void AddValue(const KVNamedParameter &p)
void SetIgnoreBool(Bool_t ignore=kTRUE)
KVHashList * GetList() const
TString GetTStringValue(const Char_t *name) const
KVNameValueList(KVNameValueList &&)=default
void WriteToEnv(TEnv *tenv, const TString &prefix="")
A generic named parameter storing values of different types.
void Set(const char *, const char *)
void Add(const KVNamedParameter &p)
TObject * First() const override
void Add(TObject *obj) override
void AddLast(TObject *obj) override
TObject * Last() const override
TSeqCollection * GetCollection() const
void AddAt(TObject *obj, Int_t idx) override
void AddFirst(TObject *obj) override
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
virtual TObject * Remove(TObject *obj)=0
virtual Int_t IndexOf(const TObject *obj) const
unsigned long long ULong64_t