MarlinMT
0.1.0
|
ParameterBase<T> class Base interface for user parameters. More...
#include <Parameter.h>
Inherited by marlinmt::Parameter< T >.
Public Types | |
using | ValueType = T |
Public Member Functions | |
virtual | ~ParameterBase ()=default |
Default destructor. More... | |
ParameterBase (EParameterType paramType, const std::string &na, const std::string &desc) | |
Constructor. More... | |
ParameterBase (EParameterType paramType, const std::string &na, const std::string &desc, const T &defVal) | |
Constructor. More... | |
ParameterBase (Configurable &conf, EParameterType paramType, const std::string &na, const std::string &desc) | |
Constructor. More... | |
ParameterBase (Configurable &conf, EParameterType paramType, const std::string &na, const std::string &desc, const T &defVal) | |
Constructor. More... | |
EParameterType | type () const |
Get the parameter type. More... | |
const std::string & | name () const |
Get the property name. More... | |
const std::string & | description () const |
Get the parameter description. More... | |
bool | isSet () const |
Whether the parameter has been set. More... | |
bool | hasDefault () const |
Whether the parameter has a default value. More... | |
std::string | str () const |
Get the parameter value as string. More... | |
std::string | defaultStr () const |
Get the parameter default value as string. More... | |
std::string | typeStr () const |
Get the parameter type as string. More... | |
const std::type_index & | typeIndex () const |
Get a type index object of the underlying type. More... | |
operator T () const | |
Implicit conversion operator to get the parameter value. More... | |
T | get () const |
Get the parameter value. More... | |
T | get (const T &fallback) const |
Get the parameter value. More... | |
void | set (const T &value) |
Set the parameter value. More... | |
void | reset () |
Reset the parameter value (only) More... | |
void | setValidator (ValidatorFunctionT< T > validator) |
Set the validator function. More... | |
Protected Attributes | |
std::shared_ptr< T > | _value { std::make_shared<T>() } |
The parameter value address. More... | |
std::shared_ptr< ParameterImpl > | _impl {} |
A shared pointer on the parameter implementation. More... | |
ParameterBase<T> class Base interface for user parameters.
See daughter classes for usage
Definition at line 427 of file Parameter.h.
using marlinmt::ParameterBase< T >::ValueType = T |
Definition at line 429 of file Parameter.h.
|
virtualdefault |
Default destructor.
|
inline |
Constructor.
paramType | the parameter type |
na | the parameter name |
desc | the parameter description |
Definition at line 441 of file Parameter.h.
|
inline |
Constructor.
paramType | the parameter type |
na | the parameter name |
desc | the parameter description |
defVal | the default parameter value |
Definition at line 453 of file Parameter.h.
|
inline |
Constructor.
conf | a configurable object to which the parameter is added |
paramType | the parameter type |
na | the parameter name |
desc | the parameter description |
Definition at line 465 of file Parameter.h.
|
inline |
Constructor.
conf | a configurable object to which the parameter is added |
paramType | the parameter type |
na | the parameter name |
desc | the parameter description |
defVal | the default parameter value |
Definition at line 478 of file Parameter.h.
|
inline |
Get the parameter default value as string.
Definition at line 527 of file Parameter.h.
|
inline |
Get the parameter description.
Definition at line 499 of file Parameter.h.
|
inline |
Get the parameter value.
Throws if the parameter is not set and has no default value
Definition at line 556 of file Parameter.h.
Referenced by marlinmt::concurrency::PEPScheduler::configurePool(), marlinmt::LCIOOutputProcessor::getWriteCollections(), marlinmt::StdHepFileSource::initialize(), marlinmt::BookStoreManager::initialize(), marlinmt::LoggerManager::initialize(), marlinmt::GeometryManager::initialize(), marlinmt::operator!=(), marlinmt::operator==(), marlinmt::operator>(), marlinmt::operator>=(), marlinmt::StdHepFileSource::readOne(), marlinmt::Component::setup(), and marlinmt::BookStoreManager::writeToDisk().
|
inline |
Get the parameter value.
Returns the fallback value if the parameter is not set and has no default value
Definition at line 564 of file Parameter.h.
|
inline |
Whether the parameter has a default value.
Definition at line 513 of file Parameter.h.
|
inline |
Whether the parameter has been set.
Definition at line 506 of file Parameter.h.
Referenced by marlinmt::concurrency::PEPScheduler::configurePool(), marlinmt::LCIOOutputProcessor::getWriteCollections(), and marlinmt::Component::setup().
|
inline |
Get the property name.
Definition at line 492 of file Parameter.h.
|
inline |
Implicit conversion operator to get the parameter value.
Definition at line 548 of file Parameter.h.
|
inline |
Reset the parameter value (only)
Definition at line 580 of file Parameter.h.
|
inline |
Set the parameter value.
value | the new parameter value |
Definition at line 573 of file Parameter.h.
|
inline |
Set the validator function.
validator | the validator |
Definition at line 589 of file Parameter.h.
Referenced by marlinmt::CPUCrunchingProcessor::CPUCrunchingProcessor().
|
inline |
Get the parameter value as string.
Definition at line 520 of file Parameter.h.
|
inline |
Get the parameter type.
Definition at line 485 of file Parameter.h.
|
inline |
Get a type index object of the underlying type.
Definition at line 541 of file Parameter.h.
|
inline |
Get the parameter type as string.
Definition at line 534 of file Parameter.h.
|
protected |
A shared pointer on the parameter implementation.
Definition at line 597 of file Parameter.h.
|
protected |
The parameter value address.
Definition at line 595 of file Parameter.h.