#include <BCParameterSet.h>
allow access by name into list of BCParameter.
- Author
- Frederik Beaujean
-
Daniel Greenwald
- Note
- Parameters are not owned, and will not be deleted by BCParameterSet.
Definition at line 28 of file BCParameterSet.h.
Add a parameter if no parameter of same name exists yet.
- Parameters
-
- Returns
- True if successful.
Definition at line 19 of file BCParameterSet.cxx.
24 for (
unsigned int i = 0; i <
fPars.size() ; ++i)
25 if ( parameter->GetName() ==
fPars[i]->GetName() ) {
26 BCLog::OutError(TString::Format(
"BCParameterSet::Add : Parameter with name %s exists already. ",
27 parameter->GetName().data()));
32 fPars.push_back(parameter);
void BCParameterSet::Clear |
( |
bool |
hard) | |
|
BCParameter* BCParameterSet::Get |
( |
unsigned |
index) | |
const |
|
inline |
Safe access, but slightly less efficient access to parameter.
- Parameters
-
- Returns
- The pointer at index position or NULL if invalid index.
Definition at line 58 of file BCParameterSet.h.
BCParameter* BCParameterSet::Get |
( |
const std::string & |
name) | |
const |
|
inline |
Safe access, but slightly less efficient access to parameter.
- Parameters
-
- Returns
- The pointer at index position or NULL if invalid index.
Definition at line 69 of file BCParameterSet.h.
unsigned BCParameterSet::Index |
( |
const std::string & |
name) | |
const |
Find index of parameter identified by name
Definition at line 59 of file BCParameterSet.cxx.
61 for (
unsigned int i=0; i <
fPars.size() ; ++i)
62 if (name ==
fPars[i]->GetName())
65 BCLog::OutWarning(TString::Format(
"BCParameterSet::Index: no parameter named '%s'", name.c_str()));
BCParameter* BCParameterSet::operator[] |
( |
unsigned |
index) | |
const |
|
inline |
Raw and fast access.
- Parameters
-
- Returns
- Parameter
Definition at line 47 of file BCParameterSet.h.
unsigned BCParameterSet::Size |
( |
) | |
const |
|
inline |
bool BCParameterSet::ValidIndex |
( |
unsigned |
index, |
|
|
const std::string |
caller = "CheckIndex" |
|
) |
| const |
Check if indes is in range
- Parameters
-
index | Index |
caller | Optional string to identify caller for debug output |
- Returns
Definition at line 48 of file BCParameterSet.cxx.
50 if (index >=
fPars.size()) {
51 BCLog::OutError(TString::Format(
"BCParameterSet::%s : Parameter index %u out of range", caller.c_str(), index));
The documentation for this class was generated from the following files: