Skip to content

Commit e9dbd71

Browse files
committed
Use dictionary concepts in GrepCore.hpp
1 parent 6ed6d74 commit e9dbd71

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

components/core/src/clp/GrepCore.hpp

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <string_utils/string_utils.hpp>
1515

1616
#include "Defs.h"
17+
#include "DictionaryConcepts.hpp"
1718
#include "EncodedVariableInterpreter.hpp"
1819
#include "ir/parsing.hpp"
1920
#include "ir/types.hpp"
@@ -42,7 +43,9 @@ class GrepCore {
4243
* @param use_heuristic
4344
* @return Query if it may match a message, std::nullopt otherwise
4445
*/
45-
template <typename LogTypeDictionaryReaderType, typename VariableDictionaryReaderType>
46+
template <
47+
LogTypeDictionaryReaderReq LogTypeDictionaryReaderType,
48+
VariableDictionaryReaderReq VariableDictionaryReaderType>
4649
static std::optional<Query> process_raw_query(
4750
LogTypeDictionaryReaderType const& logtype_dict,
4851
VariableDictionaryReaderType const& var_dict,
@@ -107,7 +110,7 @@ class GrepCore {
107110
* @param logtype
108111
* @return true if this token might match a message, false otherwise
109112
*/
110-
template <typename VariableDictionaryReaderType>
113+
template <VariableDictionaryReaderReq VariableDictionaryReaderType>
111114
static bool process_var_token(
112115
QueryToken const& query_token,
113116
VariableDictionaryReaderType const& var_dict,
@@ -132,9 +135,10 @@ class GrepCore {
132135
* @return SubQueryMatchabilityResult::MayMatch
133136
*/
134137
template <
135-
typename LogTypeDictionaryReaderType,
136-
typename VariableDictionaryReaderType,
137-
typename LogTypeDictionaryEntryType = typename LogTypeDictionaryReaderType::entry_t>
138+
LogTypeDictionaryReaderReq LogTypeDictionaryReaderType,
139+
VariableDictionaryReaderReq VariableDictionaryReaderType,
140+
LogTypeDictionaryEntryReq LogTypeDictionaryEntryType
141+
= typename LogTypeDictionaryReaderType::entry_t>
138142
static SubQueryMatchabilityResult generate_logtypes_and_vars_for_subquery(
139143
LogTypeDictionaryReaderType const& logtype_dict,
140144
VariableDictionaryReaderType const& var_dict,
@@ -145,7 +149,9 @@ class GrepCore {
145149
);
146150
};
147151

148-
template <typename LogTypeDictionaryReaderType, typename VariableDictionaryReaderType>
152+
template <
153+
LogTypeDictionaryReaderReq LogTypeDictionaryReaderType,
154+
VariableDictionaryReaderReq VariableDictionaryReaderType>
149155
std::optional<Query> GrepCore::process_raw_query(
150156
LogTypeDictionaryReaderType const& logtype_dict,
151157
VariableDictionaryReaderType const& var_dict,
@@ -266,7 +272,7 @@ std::optional<Query> GrepCore::process_raw_query(
266272
};
267273
}
268274

269-
template <typename VariableDictionaryReaderType>
275+
template <VariableDictionaryReaderReq VariableDictionaryReaderType>
270276
bool GrepCore::process_var_token(
271277
QueryToken const& query_token,
272278
VariableDictionaryReaderType const& var_dict,
@@ -328,9 +334,9 @@ bool GrepCore::process_var_token(
328334
}
329335

330336
template <
331-
typename LogTypeDictionaryReaderType,
332-
typename VariableDictionaryReaderType,
333-
typename LogTypeDictionaryEntryType>
337+
LogTypeDictionaryReaderReq LogTypeDictionaryReaderType,
338+
VariableDictionaryReaderReq VariableDictionaryReaderType,
339+
LogTypeDictionaryEntryReq LogTypeDictionaryEntryType>
334340
GrepCore::SubQueryMatchabilityResult GrepCore::generate_logtypes_and_vars_for_subquery(
335341
LogTypeDictionaryReaderType const& logtype_dict,
336342
VariableDictionaryReaderType const& var_dict,

0 commit comments

Comments
 (0)