Belle II Software development
NNTParam< T > Class Template Reference

Class to represent a complete set to describe a Neurotrigger. More...

#include <NeuroTriggerParameters.h>

Public Member Functions

 NNTParam ()
 this is a typewrapper class for the parameters for the neurotrigger.
 
 NNTParam (const T &xvalue)
 copy constructor
 
 operator T () const
 return the value of the data type this wrapper class is holding
 
operator= (const T t)
 assignment operator, but checks first if the variable is already locked
 
NNTParam operator() () const
 return the value of the data type this wrapper class is holding
 
bool isSet () const
 check, if variable was already initialized
 
void lock ()
 lock the variable, to make it read only
 
bool isLocked () const
 check, if variable was already locked and is read only now
 

Private Attributes

m_value
 holding the value
 
bool m_set = false
 
bool m_locked = false
 saves the "locked" state
 

Detailed Description

template<class T>
class Belle2::NNTParam< T >

Class to represent a complete set to describe a Neurotrigger.

Definition at line 24 of file NeuroTriggerParameters.h.

Constructor & Destructor Documentation

◆ NNTParam() [1/2]

NNTParam ( )
inline

this is a typewrapper class for the parameters for the neurotrigger.

for every parameter, it can also store the information wether the parameter was aleady set or if it is locked.

Definition at line 28 of file NeuroTriggerParameters.h.

28{}

◆ NNTParam() [2/2]

NNTParam ( const T &  xvalue)
inline

copy constructor

Definition at line 30 of file NeuroTriggerParameters.h.

31 {
32 m_value = xvalue;
33 m_set = true;
34 }
T m_value
holding the value

Member Function Documentation

◆ isLocked()

bool isLocked ( ) const
inline

check, if variable was already locked and is read only now

Definition at line 59 of file NeuroTriggerParameters.h.

59{return m_locked;}
bool m_locked
saves the "locked" state

◆ isSet()

bool isSet ( ) const
inline

check, if variable was already initialized

Definition at line 55 of file NeuroTriggerParameters.h.

55{return m_set;}

◆ lock()

void lock ( )
inline

lock the variable, to make it read only

Definition at line 57 of file NeuroTriggerParameters.h.

57{m_locked = true;}

◆ operator T()

operator T ( ) const
inline

return the value of the data type this wrapper class is holding

Definition at line 36 of file NeuroTriggerParameters.h.

36{ return m_value;}

◆ operator()()

NNTParam operator() ( ) const
inline

return the value of the data type this wrapper class is holding

Definition at line 51 of file NeuroTriggerParameters.h.

51{return m_value;}

◆ operator=()

T operator= ( const T  t)
inline

assignment operator, but checks first if the variable is already locked

Definition at line 39 of file NeuroTriggerParameters.h.

40 {
41 if (!m_locked) {
42 m_value = t;
43 m_set = true;
44 } else {
45 throw std::invalid_argument("parameter is read only! (locked)");
46 }
47 return *this;
48 }

Member Data Documentation

◆ m_locked

bool m_locked = false
private

saves the "locked" state

Definition at line 67 of file NeuroTriggerParameters.h.

◆ m_set

bool m_set = false
private

Definition at line 65 of file NeuroTriggerParameters.h.

◆ m_value

T m_value
private

holding the value

Definition at line 63 of file NeuroTriggerParameters.h.


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