Jpp 19.3.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
JParametersHelper.hh
Go to the documentation of this file.
1#ifndef __JTRIGGER__JPARAMETERSHELPER__
2#define __JTRIGGER__JPARAMETERSHELPER__
3
4/**
5 * \author mdejong
6 */
7
8namespace JTRIGGER {}
9namespace JPP { using namespace JTRIGGER; }
10
11namespace 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
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary classes and methods for triggering.
Wrapper class to share parameters.
JParametersHelper(const JParameters_t &parameters)
Copy constructor.
JParametersHelper()
Default constructor.
static const JParameters_t & getParameters()
Get latest parameters.
static const JParameters_t *& get()
Get pointer to latest parameters.