11
11
#include " ffi/ir_stream/decoding_methods.hpp"
12
12
#include " ir/LogEvent.hpp"
13
13
#include " ir/types.hpp"
14
+ #include " LogTypeDictionaryEntryReq.hpp"
14
15
#include " Query.hpp"
15
16
#include " spdlog_with_specializations.hpp"
16
17
#include " TraceableException.hpp"
17
18
#include " type_utils.hpp"
19
+ #include " VariableDictionaryReaderReq.hpp"
20
+ #include " VariableDictionaryWriterReq.hpp"
18
21
19
22
namespace clp {
20
23
/* *
@@ -123,7 +126,9 @@ class EncodedVariableInterpreter {
123
126
* @param encoded_vars
124
127
* @param var_ids
125
128
*/
126
- template <typename LogTypeDictionaryEntryType, typename VariableDictionaryWriterType>
129
+ template <
130
+ LogTypeDictionaryEntryReq LogTypeDictionaryEntryType,
131
+ VariableDictionaryWriterReq VariableDictionaryWriterType>
127
132
static void encode_and_add_to_dictionary (
128
133
std::string_view message,
129
134
LogTypeDictionaryEntryType& logtype_dict_entry,
@@ -149,8 +154,8 @@ class EncodedVariableInterpreter {
149
154
*/
150
155
template <
151
156
typename EncodedVariableType,
152
- typename LogTypeDictionaryEntryType,
153
- typename VariableDictionaryWriterType>
157
+ LogTypeDictionaryEntryReq LogTypeDictionaryEntryType,
158
+ VariableDictionaryWriterReq VariableDictionaryWriterType>
154
159
static void encode_and_add_to_dictionary (
155
160
ir::LogEvent<EncodedVariableType> const & log_event,
156
161
LogTypeDictionaryEntryType& logtype_dict_entry,
@@ -172,8 +177,8 @@ class EncodedVariableInterpreter {
172
177
* @return true if successful, false otherwise
173
178
*/
174
179
template <
175
- typename LogTypeDictionaryEntryType,
176
- typename VariableDictionaryReaderType,
180
+ LogTypeDictionaryEntryReq LogTypeDictionaryEntryType,
181
+ VariableDictionaryReaderReq VariableDictionaryReaderType,
177
182
typename EncodedVariableContainerType>
178
183
static bool decode_variables_into_message (
179
184
LogTypeDictionaryEntryType const & logtype_dict_entry,
@@ -195,7 +200,7 @@ class EncodedVariableInterpreter {
195
200
* dictionary
196
201
* @return false otherwise
197
202
*/
198
- template <typename VariableDictionaryReaderType>
203
+ template <VariableDictionaryReaderReq VariableDictionaryReaderType>
199
204
static bool encode_and_search_dictionary (
200
205
std::string_view var_str,
201
206
VariableDictionaryReaderType const & var_dict,
@@ -207,16 +212,13 @@ class EncodedVariableInterpreter {
207
212
* Search for the given string-form variable in the variable dictionary, encode any matches, and
208
213
* add them to the given sub-query.
209
214
* @tparam VariableDictionaryReaderType
210
- * @tparam VariableDictionaryEntryType
211
215
* @param var_wildcard_str
212
216
* @param var_dict
213
217
* @param ignore_case
214
218
* @param sub_query
215
219
* @return true if any match found, false otherwise
216
220
*/
217
- template <
218
- typename VariableDictionaryReaderType,
219
- typename VariableDictionaryEntryType = typename VariableDictionaryReaderType::entry_t >
221
+ template <VariableDictionaryReaderReq VariableDictionaryReaderType>
220
222
static bool wildcard_search_dictionary_and_get_encoded_matches (
221
223
std::string_view var_wildcard_str,
222
224
VariableDictionaryReaderType const & var_dict,
@@ -237,7 +239,9 @@ class EncodedVariableInterpreter {
237
239
* variable)
238
240
* @return The encoded variable
239
241
*/
240
- template <typename LogTypeDictionaryEntryType, typename VariableDictionaryWriterType>
242
+ template <
243
+ LogTypeDictionaryEntryReq LogTypeDictionaryEntryType,
244
+ VariableDictionaryWriterReq VariableDictionaryWriterType>
241
245
static encoded_variable_t encode_var (
242
246
std::string_view var,
243
247
LogTypeDictionaryEntryType& logtype_dict_entry,
@@ -256,7 +260,9 @@ class EncodedVariableInterpreter {
256
260
* @param var_ids A container to add the dictionary ID to
257
261
* @return The dictionary ID
258
262
*/
259
- template <typename LogTypeDictionaryEntryType, typename VariableDictionaryWriterType>
263
+ template <
264
+ LogTypeDictionaryEntryReq LogTypeDictionaryEntryType,
265
+ VariableDictionaryWriterReq VariableDictionaryWriterType>
260
266
static variable_dictionary_id_t add_dict_var (
261
267
std::string_view var,
262
268
LogTypeDictionaryEntryType& logtype_dict_entry,
@@ -265,7 +271,9 @@ class EncodedVariableInterpreter {
265
271
);
266
272
};
267
273
268
- template <typename LogTypeDictionaryEntryType, typename VariableDictionaryWriterType>
274
+ template <
275
+ LogTypeDictionaryEntryReq LogTypeDictionaryEntryType,
276
+ VariableDictionaryWriterReq VariableDictionaryWriterType>
269
277
void EncodedVariableInterpreter::encode_and_add_to_dictionary (
270
278
std::string_view message,
271
279
LogTypeDictionaryEntryType& logtype_dict_entry,
@@ -289,8 +297,8 @@ void EncodedVariableInterpreter::encode_and_add_to_dictionary(
289
297
290
298
template <
291
299
typename EncodedVariableType,
292
- typename LogTypeDictionaryEntryType,
293
- typename VariableDictionaryWriterType>
300
+ LogTypeDictionaryEntryReq LogTypeDictionaryEntryType,
301
+ VariableDictionaryWriterReq VariableDictionaryWriterType>
294
302
void EncodedVariableInterpreter::encode_and_add_to_dictionary (
295
303
ir::LogEvent<EncodedVariableType> const & log_event,
296
304
LogTypeDictionaryEntryType& logtype_dict_entry,
@@ -362,8 +370,8 @@ void EncodedVariableInterpreter::encode_and_add_to_dictionary(
362
370
}
363
371
364
372
template <
365
- typename LogTypeDictionaryEntryType,
366
- typename VariableDictionaryReaderType,
373
+ LogTypeDictionaryEntryReq LogTypeDictionaryEntryType,
374
+ VariableDictionaryReaderReq VariableDictionaryReaderType,
367
375
typename EncodedVariableContainerType>
368
376
bool EncodedVariableInterpreter::decode_variables_into_message (
369
377
LogTypeDictionaryEntryType const & logtype_dict_entry,
@@ -436,7 +444,7 @@ bool EncodedVariableInterpreter::decode_variables_into_message(
436
444
return true ;
437
445
}
438
446
439
- template <typename VariableDictionaryReaderType>
447
+ template <VariableDictionaryReaderReq VariableDictionaryReaderType>
440
448
bool EncodedVariableInterpreter::encode_and_search_dictionary (
441
449
std::string_view var_str,
442
450
VariableDictionaryReaderType const & var_dict,
@@ -485,15 +493,15 @@ bool EncodedVariableInterpreter::encode_and_search_dictionary(
485
493
return true ;
486
494
}
487
495
488
- template <typename VariableDictionaryReaderType, typename VariableDictionaryEntryType >
496
+ template <VariableDictionaryReaderReq VariableDictionaryReaderType>
489
497
bool EncodedVariableInterpreter::wildcard_search_dictionary_and_get_encoded_matches (
490
498
std::string_view var_wildcard_str,
491
499
VariableDictionaryReaderType const & var_dict,
492
500
bool ignore_case,
493
501
SubQuery& sub_query
494
502
) {
495
503
// Find matches
496
- std::unordered_set<VariableDictionaryEntryType const *> var_dict_entries;
504
+ std::unordered_set<typename VariableDictionaryReaderType::Entry const *> var_dict_entries;
497
505
var_dict.get_entries_matching_wildcard_string (var_wildcard_str, ignore_case, var_dict_entries);
498
506
if (var_dict_entries.empty ()) {
499
507
// Not in dictionary
@@ -513,7 +521,9 @@ bool EncodedVariableInterpreter::wildcard_search_dictionary_and_get_encoded_matc
513
521
return true ;
514
522
}
515
523
516
- template <typename LogTypeDictionaryEntryType, typename VariableDictionaryWriterType>
524
+ template <
525
+ LogTypeDictionaryEntryReq LogTypeDictionaryEntryType,
526
+ VariableDictionaryWriterReq VariableDictionaryWriterType>
517
527
encoded_variable_t EncodedVariableInterpreter::encode_var (
518
528
std::string_view var,
519
529
LogTypeDictionaryEntryType& logtype_dict_entry,
@@ -532,7 +542,9 @@ encoded_variable_t EncodedVariableInterpreter::encode_var(
532
542
return encoded_var;
533
543
}
534
544
535
- template <typename LogTypeDictionaryEntryType, typename VariableDictionaryWriterType>
545
+ template <
546
+ LogTypeDictionaryEntryReq LogTypeDictionaryEntryType,
547
+ VariableDictionaryWriterReq VariableDictionaryWriterType>
536
548
variable_dictionary_id_t EncodedVariableInterpreter::add_dict_var (
537
549
std::string_view var,
538
550
LogTypeDictionaryEntryType& logtype_dict_entry,
0 commit comments