#ifndef __JTRIGGER__JPARAMETERSHELPER__ #define __JTRIGGER__JPARAMETERSHELPER__ /** * \author mdejong */ namespace JTRIGGER {} namespace JPP { using namespace JTRIGGER; } namespace JTRIGGER { /** * Wrapper class to share parameters. * * The static method JParametersHelper::getParameters can be used to obtain the latest parameter values. */ template struct JParametersHelper : public JParameters_t { /** * Default constructor. */ JParametersHelper() : JParameters_t() { get() = static_cast(this); } /** * Copy constructor. * * \param parameters parameters */ JParametersHelper(const JParameters_t& parameters) : JParameters_t(parameters) { get() = static_cast(this); } /** * Get latest parameters. * * \return parameters */ static const JParameters_t& getParameters() { return *get(); } private: /** * Get pointer to latest parameters. * * \return pointer to latest parameters */ static const JParameters_t*& get() { static const JParameters_t* parameters; return parameters; } }; } #endif