Jpp  18.1.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JParametersHelper.hh
Go to the documentation of this file.
1 #ifndef __JTRIGGER__JPARAMETERSHELPER__
2 #define __JTRIGGER__JPARAMETERSHELPER__
3 
4 /**
5  * \author mdejong
6  */
7 
8 namespace JTRIGGER {}
9 namespace JPP { using namespace JTRIGGER; }
10 
11 namespace JTRIGGER {
12 
13  /**
14  * Wrapper class to share parameters.
15  *
16  * The static method JParametersHelper::getParameters can be used to obtain the latest parameter values.
17  */
18  template<class JParameters_t>
20  public JParameters_t
21  {
22  /**
23  * Default constructor.
24  */
26  JParameters_t()
27  {
28  get() = static_cast<const JParameters_t*>(this);
29  }
30 
31 
32  /**
33  * Copy constructor.
34  *
35  * \param parameters parameters
36  */
37  JParametersHelper(const JParameters_t& parameters) :
38  JParameters_t(parameters)
39  {
40  get() = static_cast<const JParameters_t*>(this);
41  }
42 
43 
44  /**
45  * Get latest parameters.
46  *
47  * \return parameters
48  */
49  static const JParameters_t& getParameters()
50  {
51  return *get();
52  }
53 
54  private:
55  /**
56  * Get pointer to latest parameters.
57  *
58  * \return pointer to latest parameters
59  */
60  static const JParameters_t*& get()
61  {
62  static const JParameters_t* parameters;
63 
64  return parameters;
65  }
66  };
67 }
68 
69 #endif
JParametersHelper()
Default constructor.
Wrapper class to share parameters.
static const JParameters_t & getParameters()
Get latest parameters.
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
Definition: diff-Tuna.sh:38
JParametersHelper(const JParameters_t &parameters)
Copy constructor.