1111#include " ffi/ir_stream/decoding_methods.hpp"
1212#include " ir/LogEvent.hpp"
1313#include " ir/types.hpp"
14+ #include " LogTypeDictionaryEntryReq.hpp"
1415#include " Query.hpp"
1516#include " spdlog_with_specializations.hpp"
1617#include " TraceableException.hpp"
1718#include " type_utils.hpp"
19+ #include " VariableDictionaryReaderReq.hpp"
20+ #include " VariableDictionaryWriterReq.hpp"
1821
1922namespace clp {
2023/* *
@@ -123,7 +126,9 @@ class EncodedVariableInterpreter {
123126 * @param encoded_vars
124127 * @param var_ids
125128 */
126- template <typename LogTypeDictionaryEntryType, typename VariableDictionaryWriterType>
129+ template <
130+ LogTypeDictionaryEntryReq LogTypeDictionaryEntryType,
131+ VariableDictionaryWriterReq VariableDictionaryWriterType>
127132 static void encode_and_add_to_dictionary (
128133 std::string_view message,
129134 LogTypeDictionaryEntryType& logtype_dict_entry,
@@ -149,8 +154,8 @@ class EncodedVariableInterpreter {
149154 */
150155 template <
151156 typename EncodedVariableType,
152- typename LogTypeDictionaryEntryType,
153- typename VariableDictionaryWriterType>
157+ LogTypeDictionaryEntryReq LogTypeDictionaryEntryType,
158+ VariableDictionaryWriterReq VariableDictionaryWriterType>
154159 static void encode_and_add_to_dictionary (
155160 ir::LogEvent<EncodedVariableType> const & log_event,
156161 LogTypeDictionaryEntryType& logtype_dict_entry,
@@ -172,8 +177,8 @@ class EncodedVariableInterpreter {
172177 * @return true if successful, false otherwise
173178 */
174179 template <
175- typename LogTypeDictionaryEntryType,
176- typename VariableDictionaryReaderType,
180+ LogTypeDictionaryEntryReq LogTypeDictionaryEntryType,
181+ VariableDictionaryReaderReq VariableDictionaryReaderType,
177182 typename EncodedVariableContainerType>
178183 static bool decode_variables_into_message (
179184 LogTypeDictionaryEntryType const & logtype_dict_entry,
@@ -195,7 +200,7 @@ class EncodedVariableInterpreter {
195200 * dictionary
196201 * @return false otherwise
197202 */
198- template <typename VariableDictionaryReaderType>
203+ template <VariableDictionaryReaderReq VariableDictionaryReaderType>
199204 static bool encode_and_search_dictionary (
200205 std::string_view var_str,
201206 VariableDictionaryReaderType const & var_dict,
@@ -207,16 +212,13 @@ class EncodedVariableInterpreter {
207212 * Search for the given string-form variable in the variable dictionary, encode any matches, and
208213 * add them to the given sub-query.
209214 * @tparam VariableDictionaryReaderType
210- * @tparam VariableDictionaryEntryType
211215 * @param var_wildcard_str
212216 * @param var_dict
213217 * @param ignore_case
214218 * @param sub_query
215219 * @return true if any match found, false otherwise
216220 */
217- template <
218- typename VariableDictionaryReaderType,
219- typename VariableDictionaryEntryType = typename VariableDictionaryReaderType::entry_t >
221+ template <VariableDictionaryReaderReq VariableDictionaryReaderType>
220222 static bool wildcard_search_dictionary_and_get_encoded_matches (
221223 std::string_view var_wildcard_str,
222224 VariableDictionaryReaderType const & var_dict,
@@ -237,7 +239,9 @@ class EncodedVariableInterpreter {
237239 * variable)
238240 * @return The encoded variable
239241 */
240- template <typename LogTypeDictionaryEntryType, typename VariableDictionaryWriterType>
242+ template <
243+ LogTypeDictionaryEntryReq LogTypeDictionaryEntryType,
244+ VariableDictionaryWriterReq VariableDictionaryWriterType>
241245 static encoded_variable_t encode_var (
242246 std::string_view var,
243247 LogTypeDictionaryEntryType& logtype_dict_entry,
@@ -256,7 +260,9 @@ class EncodedVariableInterpreter {
256260 * @param var_ids A container to add the dictionary ID to
257261 * @return The dictionary ID
258262 */
259- template <typename LogTypeDictionaryEntryType, typename VariableDictionaryWriterType>
263+ template <
264+ LogTypeDictionaryEntryReq LogTypeDictionaryEntryType,
265+ VariableDictionaryWriterReq VariableDictionaryWriterType>
260266 static variable_dictionary_id_t add_dict_var (
261267 std::string_view var,
262268 LogTypeDictionaryEntryType& logtype_dict_entry,
@@ -265,7 +271,9 @@ class EncodedVariableInterpreter {
265271 );
266272};
267273
268- template <typename LogTypeDictionaryEntryType, typename VariableDictionaryWriterType>
274+ template <
275+ LogTypeDictionaryEntryReq LogTypeDictionaryEntryType,
276+ VariableDictionaryWriterReq VariableDictionaryWriterType>
269277void EncodedVariableInterpreter::encode_and_add_to_dictionary (
270278 std::string_view message,
271279 LogTypeDictionaryEntryType& logtype_dict_entry,
@@ -289,8 +297,8 @@ void EncodedVariableInterpreter::encode_and_add_to_dictionary(
289297
290298template <
291299 typename EncodedVariableType,
292- typename LogTypeDictionaryEntryType,
293- typename VariableDictionaryWriterType>
300+ LogTypeDictionaryEntryReq LogTypeDictionaryEntryType,
301+ VariableDictionaryWriterReq VariableDictionaryWriterType>
294302void EncodedVariableInterpreter::encode_and_add_to_dictionary (
295303 ir::LogEvent<EncodedVariableType> const & log_event,
296304 LogTypeDictionaryEntryType& logtype_dict_entry,
@@ -362,8 +370,8 @@ void EncodedVariableInterpreter::encode_and_add_to_dictionary(
362370}
363371
364372template <
365- typename LogTypeDictionaryEntryType,
366- typename VariableDictionaryReaderType,
373+ LogTypeDictionaryEntryReq LogTypeDictionaryEntryType,
374+ VariableDictionaryReaderReq VariableDictionaryReaderType,
367375 typename EncodedVariableContainerType>
368376bool EncodedVariableInterpreter::decode_variables_into_message (
369377 LogTypeDictionaryEntryType const & logtype_dict_entry,
@@ -436,7 +444,7 @@ bool EncodedVariableInterpreter::decode_variables_into_message(
436444 return true ;
437445}
438446
439- template <typename VariableDictionaryReaderType>
447+ template <VariableDictionaryReaderReq VariableDictionaryReaderType>
440448bool EncodedVariableInterpreter::encode_and_search_dictionary (
441449 std::string_view var_str,
442450 VariableDictionaryReaderType const & var_dict,
@@ -485,15 +493,15 @@ bool EncodedVariableInterpreter::encode_and_search_dictionary(
485493 return true ;
486494}
487495
488- template <typename VariableDictionaryReaderType, typename VariableDictionaryEntryType >
496+ template <VariableDictionaryReaderReq VariableDictionaryReaderType>
489497bool EncodedVariableInterpreter::wildcard_search_dictionary_and_get_encoded_matches (
490498 std::string_view var_wildcard_str,
491499 VariableDictionaryReaderType const & var_dict,
492500 bool ignore_case,
493501 SubQuery& sub_query
494502) {
495503 // Find matches
496- std::unordered_set<VariableDictionaryEntryType const *> var_dict_entries;
504+ std::unordered_set<typename VariableDictionaryReaderType::Entry const *> var_dict_entries;
497505 var_dict.get_entries_matching_wildcard_string (var_wildcard_str, ignore_case, var_dict_entries);
498506 if (var_dict_entries.empty ()) {
499507 // Not in dictionary
@@ -513,7 +521,9 @@ bool EncodedVariableInterpreter::wildcard_search_dictionary_and_get_encoded_matc
513521 return true ;
514522}
515523
516- template <typename LogTypeDictionaryEntryType, typename VariableDictionaryWriterType>
524+ template <
525+ LogTypeDictionaryEntryReq LogTypeDictionaryEntryType,
526+ VariableDictionaryWriterReq VariableDictionaryWriterType>
517527encoded_variable_t EncodedVariableInterpreter::encode_var (
518528 std::string_view var,
519529 LogTypeDictionaryEntryType& logtype_dict_entry,
@@ -532,7 +542,9 @@ encoded_variable_t EncodedVariableInterpreter::encode_var(
532542 return encoded_var;
533543}
534544
535- template <typename LogTypeDictionaryEntryType, typename VariableDictionaryWriterType>
545+ template <
546+ LogTypeDictionaryEntryReq LogTypeDictionaryEntryType,
547+ VariableDictionaryWriterReq VariableDictionaryWriterType>
536548variable_dictionary_id_t EncodedVariableInterpreter::add_dict_var (
537549 std::string_view var,
538550 LogTypeDictionaryEntryType& logtype_dict_entry,
0 commit comments