Hammer  1.0.0
Helicity Amplitude Module for Matrix Element Reweighting
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Hammer::Setting Class Reference

container for an Hammer run option More...

#include <Setting.hh>

+ Collaboration diagram for Hammer::Setting:

Public Types

using WrittenSettingType = std::pair< flatbuffers::Offset< void >, Serial::FBSettingTypes >
 

Public Member Functions

 Setting ()
 default constructor More...
 
 Setting (const Setting &other)=default
 
Settingoperator= (const Setting &other)
 
 Setting (Setting &&other)=default
 
Settingoperator= (Setting &&other)=default
 
 ~Setting ()=default
 
 Setting (const Serial::FBSetting *msgreader)
 
template<typename T >
T * getValue ()
 access the setting value More...
 
template<typename T >
const T * getValue () const
 access the setting value (const version) More...
 
template<typename T >
void setValue (const T &value)
 modify the setting value More...
 
template<typename T >
T * getDefault ()
 get the default value of this setting More...
 
template<typename T >
const T * getDefault () const
 get the default value of this setting (const version) More...
 
template<typename T >
void setDefault (const T &value)
 modify the setting default value More...
 
void reset ()
 reset the contents of the settings More...
 
bool wasChanged () const
 
bool isSame (const Setting &other) const
 
void setDefault ()
 
void update (const Setting &other)
 
std::string toString (const bool useDefault=false) const
 properly format the value of the setting (so that can be e.g. More...
 
WrittenSettingType write (flatbuffers::FlatBufferBuilder *msgwriter) const
 

Static Public Member Functions

static void setEncodeUseDefault (bool useDefault)
 

Private Types

using MatrixType = std::vector< std::vector< double >>
 
using SettingType = boost::variant< boost::blank, bool, int, double, std::string, std::complex< double >, std::vector< std::string >, std::vector< double >, MatrixType >
 data type for the setting values More...
 

Private Member Functions

void read (const Serial::FBSetting *msgreader)
 

Private Attributes

SettingType _value
 setting value More...
 
SettingType _default
 setting default value More...
 

Static Private Attributes

static bool _encodeUseDefault = false
 

Friends

struct SettingEncoder
 
struct SettingChecker
 
class SettingWriter
 
struct SettingStringConverter
 
struct YAML::convert<::Hammer::Setting >
 

Detailed Description

container for an Hammer run option

stores the value, name, owner, description and default value of an Hammer option

Definition at line 39 of file Setting.hh.

Member Typedef Documentation

using Hammer::Setting::MatrixType = std::vector<std::vector<double>>
private

Definition at line 112 of file Setting.hh.

using Hammer::Setting::SettingType = boost::variant<boost::blank, bool, int, double, std::string, std::complex<double>, std::vector<std::string>, std::vector<double>, MatrixType>
private

data type for the setting values

Definition at line 116 of file Setting.hh.

using Hammer::Setting::WrittenSettingType = std::pair<flatbuffers::Offset<void>, Serial::FBSettingTypes>

Definition at line 98 of file Setting.hh.

Constructor & Destructor Documentation

Hammer::Setting::Setting ( )

default constructor

Definition at line 268 of file Setting.cc.

Hammer::Setting::Setting ( const Setting other)
default
Hammer::Setting::Setting ( Setting &&  other)
default
Hammer::Setting::~Setting ( )
default
Hammer::Setting::Setting ( const Serial::FBSetting *  msgreader)

Definition at line 270 of file Setting.cc.

Member Function Documentation

template<typename T >
T * Hammer::Setting::getDefault ( )

get the default value of this setting

Returns
a pointer to the default value, nullptr if the data type does not match

Definition at line 37 of file SettingDefs.hh.

template<typename T >
const T * Hammer::Setting::getDefault ( ) const

get the default value of this setting (const version)

Returns
a pointer to the default value, nullptr if the data type does not match

Definition at line 42 of file SettingDefs.hh.

template<typename T >
T * Hammer::Setting::getValue ( )

access the setting value

Returns
a pointer to the value, nullptr if the data type does not match

Definition at line 19 of file SettingDefs.hh.

template<typename T >
const T * Hammer::Setting::getValue ( ) const

access the setting value (const version)

Returns
a pointer to the value, nullptr if the data type does not match

Definition at line 24 of file SettingDefs.hh.

bool Hammer::Setting::isSame ( const Setting other) const

Definition at line 299 of file Setting.cc.

Setting & Hammer::Setting::operator= ( const Setting other)

Definition at line 274 of file Setting.cc.

Setting& Hammer::Setting::operator= ( Setting &&  other)
default
void Hammer::Setting::read ( const Serial::FBSetting *  msgreader)
private

Definition at line 325 of file Setting.cc.

void Hammer::Setting::reset ( )

reset the contents of the settings

Definition at line 286 of file Setting.cc.

template<typename T >
void Hammer::Setting::setDefault ( const T &  value)

modify the setting default value

Parameters
[in]valuethe new default value of the setting

Definition at line 47 of file SettingDefs.hh.

void Hammer::Setting::setDefault ( )

Definition at line 304 of file Setting.cc.

void Hammer::Setting::setEncodeUseDefault ( bool  useDefault)
static

Definition at line 290 of file Setting.cc.

template<typename T >
void Hammer::Setting::setValue ( const T &  value)

modify the setting value

Parameters
[in]valuethe new value of the setting

Definition at line 29 of file SettingDefs.hh.

string Hammer::Setting::toString ( const bool  useDefault = false) const

properly format the value of the setting (so that can be e.g.

displayed on a screen)

Parameters
[in]useDefaultwhether to use the current value or the default value
Returns
the formatted string

Definition at line 385 of file Setting.cc.

void Hammer::Setting::update ( const Setting other)

Definition at line 308 of file Setting.cc.

bool Hammer::Setting::wasChanged ( ) const

Definition at line 294 of file Setting.cc.

Setting::WrittenSettingType Hammer::Setting::write ( flatbuffers::FlatBufferBuilder *  msgwriter) const

Definition at line 320 of file Setting.cc.

Friends And Related Function Documentation

friend struct SettingChecker
friend

Definition at line 106 of file Setting.hh.

friend struct SettingEncoder
friend

Definition at line 105 of file Setting.hh.

friend struct SettingStringConverter
friend

Definition at line 108 of file Setting.hh.

friend class SettingWriter
friend

Definition at line 107 of file Setting.hh.

friend struct YAML::convert<::Hammer::Setting >
friend

Definition at line 109 of file Setting.hh.

Member Data Documentation

SettingType Hammer::Setting::_default
private

setting default value

Definition at line 126 of file Setting.hh.

bool Hammer::Setting::_encodeUseDefault = false
staticprivate

Definition at line 128 of file Setting.hh.

SettingType Hammer::Setting::_value
private

setting value

Definition at line 124 of file Setting.hh.


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