1 #ifndef PhysicsTools_Utilities_Variables_h
2 #define PhysicsTools_Utilities_Variables_h
6 #define DEFINE_VARIABLE_T(T, X, NAME) \
11 X(const T& x) { set(x); } \
12 inline operator T() const { return value; } \
13 inline T operator()() const { return value; } \
14 inline static const char* name() { \
15 static const char* name = NAME; \
18 inline X operator=(const T& x) { \
22 inline static void set(const T& x) { value = x; } \
30 inline std::ostream& operator<<(std::ostream& cout, const funct::X&) { return cout << funct::X::name(); } \
33 struct __useless_ignoreme
35 #define IMPLEMENT_VARIABLE_T(T, X) \
40 struct __useless_ignoreme
42 #define DEFINE_VARIABLE(X, NAME) DEFINE_VARIABLE_T(double, X, NAME)
44 #define IMPLEMENT_VARIABLE(X) IMPLEMENT_VARIABLE_T(double, X)
46 #define DEFINE_INT_VARIABLE(X, NAME) DEFINE_VARIABLE_T(int, X, NAME)
48 #define IMPLEMENT_INT_VARIABLE(X) IMPLEMENT_VARIABLE_T(int, X)
#define DEFINE_VARIABLE(X, NAME)