MarlinMT  0.1.0
marlinmt::Parameter< T > Class Template Reference

Parameter<T> class High level interface to register simple parameter values (int, float, ...). More...

#include <Parameter.h>

Inherits marlinmt::ParameterBase< T >.

Public Member Functions

 Parameter ()=delete
 Deleted constructor. More...
 
 Parameter (const Parameter< T > &)=default
 Default copy constructor. More...
 
Parameter< T > & operator= (const Parameter< T > &)=default
 Default assignement operator. More...
 
 ~Parameter ()=default
 Default destructor. More...
 
 Parameter (const std::string &na, const std::string &desc)
 Constructor. More...
 
 Parameter (const std::string &na, const std::string &desc, const T &defVal)
 Constructor. More...
 
 Parameter (Configurable &conf, const std::string &na, const std::string &desc)
 Constructor. More...
 
 Parameter (Configurable &conf, const std::string &na, const std::string &desc, const T &defVal)
 Constructor. More...
 
- Public Member Functions inherited from marlinmt::ParameterBase< T >
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...
 
get () const
 Get the parameter value. More...
 
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...
 

Additional Inherited Members

- Public Types inherited from marlinmt::ParameterBase< T >
using ValueType = T
 
- Protected Attributes inherited from marlinmt::ParameterBase< T >
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...
 

Detailed Description

template<typename T>
class marlinmt::Parameter< T >

Parameter<T> class High level interface to register simple parameter values (int, float, ...).

Definition at line 608 of file Parameter.h.

Constructor & Destructor Documentation

◆ Parameter() [1/6]

template<typename T>
marlinmt::Parameter< T >::Parameter ( )
delete

Deleted constructor.

◆ Parameter() [2/6]

template<typename T>
marlinmt::Parameter< T >::Parameter ( const Parameter< T > &  )
default

Default copy constructor.

◆ ~Parameter()

template<typename T>
marlinmt::Parameter< T >::~Parameter ( )
default

Default destructor.

◆ Parameter() [3/6]

template<typename T>
marlinmt::Parameter< T >::Parameter ( const std::string &  na,
const std::string &  desc 
)
inline

Constructor.

Parameters
nathe parameter name
descthe parameter description

Definition at line 625 of file Parameter.h.

◆ Parameter() [4/6]

template<typename T>
marlinmt::Parameter< T >::Parameter ( const std::string &  na,
const std::string &  desc,
const T &  defVal 
)
inline

Constructor.

Parameters
nathe parameter name
descthe parameter description
defValthe parameter default value

Definition at line 637 of file Parameter.h.

◆ Parameter() [5/6]

template<typename T>
marlinmt::Parameter< T >::Parameter ( Configurable conf,
const std::string &  na,
const std::string &  desc 
)
inline

Constructor.

Parameters
confthe configurable object owning the parameter
nathe parameter name
descthe parameter description

Definition at line 649 of file Parameter.h.

◆ Parameter() [6/6]

template<typename T>
marlinmt::Parameter< T >::Parameter ( Configurable conf,
const std::string &  na,
const std::string &  desc,
const T &  defVal 
)
inline

Constructor.

Parameters
confthe configurable object owning the parameter
nathe parameter name
descthe parameter description
defValthe parameter default value

Definition at line 662 of file Parameter.h.

Member Function Documentation

◆ operator=()

template<typename T>
Parameter<T>& marlinmt::Parameter< T >::operator= ( const Parameter< T > &  )
default

Default assignement operator.


The documentation for this class was generated from the following file: