Skip to content

Commit 81851e7

Browse files
aalkinktf
authored andcommitted
move unnecessary statics to .cxx
1 parent 7129f45 commit 81851e7

File tree

2 files changed

+60
-59
lines changed

2 files changed

+60
-59
lines changed

Framework/Core/include/Framework/BasicOps.h

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
// or submit itself to any jurisdiction.
1111
#ifndef O2_FRAMEWORK_BASICOPS_H_
1212
#define O2_FRAMEWORK_BASICOPS_H_
13-
#include <array>
14-
#include <string_view>
15-
#include "CommonConstants/MathConstants.h"
1613

1714
namespace o2::framework
1815
{
@@ -49,61 +46,6 @@ enum BasicOp : unsigned int {
4946
BitwiseNot,
5047
Conditional // 3-ar functions
5148
};
52-
53-
static constexpr std::array<std::string_view, BasicOp::Conditional + 1> mapping{
54-
"&&",
55-
"||",
56-
"+",
57-
"-",
58-
"/",
59-
"*",
60-
"&",
61-
"|",
62-
"^",
63-
"<",
64-
"<=",
65-
">",
66-
">=",
67-
"==",
68-
"!=",
69-
"natan2",
70-
"npow",
71-
"nsqrt",
72-
"nexp",
73-
"nlog",
74-
"nlog10",
75-
"nsin",
76-
"ncos",
77-
"ntan",
78-
"nasin",
79-
"nacos",
80-
"natan",
81-
"nabs",
82-
"nround",
83-
"nbitwise_not",
84-
"ifnode"};
85-
86-
static constexpr std::array<std::string_view, 9> mathConstants{
87-
"Almost0",
88-
"Epsilon",
89-
"Almost1",
90-
"VeryBig",
91-
"PI",
92-
"TwoPI",
93-
"PIHalf",
94-
"PIThird",
95-
"PIQuarter"};
96-
97-
static constexpr std::array<float, 9> mathConstantsValues{
98-
o2::constants::math::Almost0,
99-
o2::constants::math::Epsilon,
100-
o2::constants::math::Almost1,
101-
o2::constants::math::VeryBig,
102-
o2::constants::math::PI,
103-
o2::constants::math::TwoPI,
104-
o2::constants::math::PIHalf,
105-
o2::constants::math::PIThird,
106-
o2::constants::math::PIQuarter};
10749
} // namespace o2::framework
10850

10951
#endif // O2_FRAMEWORK_BASICOPS_H_

Framework/Core/src/Expressions.cxx

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <set>
2020
#include <stack>
2121
#include <unordered_map>
22+
#include "CommonConstants/MathConstants.h"
2223

2324
using namespace o2::framework;
2425

@@ -29,9 +30,67 @@ void unknownParameterUsed(const char* name)
2930
runtime_error_f("Unknown parameter used in expression: %s", name);
3031
}
3132

33+
/// a map between BasicOp and tokens in string expressions
34+
constexpr std::array<std::string_view, BasicOp::Conditional + 1> mapping{
35+
"&&",
36+
"||",
37+
"+",
38+
"-",
39+
"/",
40+
"*",
41+
"&",
42+
"|",
43+
"^",
44+
"<",
45+
"<=",
46+
">",
47+
">=",
48+
"==",
49+
"!=",
50+
"natan2",
51+
"npow",
52+
"nsqrt",
53+
"nexp",
54+
"nlog",
55+
"nlog10",
56+
"nsin",
57+
"ncos",
58+
"ntan",
59+
"nasin",
60+
"nacos",
61+
"natan",
62+
"nabs",
63+
"nround",
64+
"nbitwise_not",
65+
"ifnode"};
66+
67+
/// math constants to recognize in string expressions
68+
constexpr std::array<std::string_view, 9> mathConstants{
69+
"Almost0",
70+
"Epsilon",
71+
"Almost1",
72+
"VeryBig",
73+
"PI",
74+
"TwoPI",
75+
"PIHalf",
76+
"PIThird",
77+
"PIQuarter"};
78+
79+
/// values of math constants to substiture
80+
constexpr std::array<float, 9> mathConstantsValues{
81+
o2::constants::math::Almost0,
82+
o2::constants::math::Epsilon,
83+
o2::constants::math::Almost1,
84+
o2::constants::math::VeryBig,
85+
o2::constants::math::PI,
86+
o2::constants::math::TwoPI,
87+
o2::constants::math::PIHalf,
88+
o2::constants::math::PIThird,
89+
o2::constants::math::PIQuarter};
90+
3291
/// a map between BasicOp and gandiva node definitions
3392
/// note that logical 'and' and 'or' are created separately
34-
static constexpr std::array<const char*, BasicOp::Conditional + 1> basicOperationsMap = {
93+
constexpr std::array<const char*, BasicOp::Conditional + 1> basicOperationsMap = {
3594
"and",
3695
"or",
3796
"add",

0 commit comments

Comments
 (0)