From 9404cb46b1bd746ceb9dbde21800e5f7ab68ac10 Mon Sep 17 00:00:00 2001 From: gibber9809 Date: Tue, 29 Jul 2025 14:57:10 +0000 Subject: [PATCH 01/14] Add concepts for the variable and logtype dictionaries and their entries --- .../core/src/clp/DictionaryConcepts.hpp | 256 ++++++++++++++++++ 1 file changed, 256 insertions(+) create mode 100644 components/core/src/clp/DictionaryConcepts.hpp diff --git a/components/core/src/clp/DictionaryConcepts.hpp b/components/core/src/clp/DictionaryConcepts.hpp new file mode 100644 index 0000000000..912861420b --- /dev/null +++ b/components/core/src/clp/DictionaryConcepts.hpp @@ -0,0 +1,256 @@ +#ifndef CLP_DICTIONARYCONCEPTS_HPP +#define CLP_DICTIONARYCONCEPTS_HPP + +#include +#include +#include +#include +#include +#include + +#include "Defs.h" +#include "ir/types.hpp" + +namespace clp { +/** + * Requirement for the logtype dictionary entry interface. + * @tparam LogTypeDictionaryEntryType The type of the logtype dictionary entry. + */ +template +concept LogTypeDictionaryEntryReq = requires( + LogTypeDictionaryEntryType entry, + size_t length, + std::string_view msg, + size_t& begin_pos_ref, + size_t& end_pos_ref, + std::string_view& parsed_var_ref, + size_t begin_pos, + size_t placeholder_ix, + ir::VariablePlaceholder& placeholder_ref, + std::string& logtype +) { + /** + * Clears all internal state. + */ + { + entry.clear() + } -> std::same_as; + + /** + * Reserves space for a logtype string of a given length. + * @param length + */ + { + entry.reserve_constant_length(length) + } -> std::same_as; + + /** + * Parses the next variable from a message according to `ir::get_bounds_of_next_var`, + * constructing the constant part of the message's logtype in the processed range at the same + * time. + * @param msg The original log message. + * @param begin_pos_ref The beginning position of the last variable. This parameter is updated + * to the beginning position of the next variable. + * @param end_pos_ref The ending position of the last variable (exclusive). This parameter is + * updated to the ending position of the next variable (exclusive). + * @return Whether another variable was found or not. + */ + { + entry.parse_next_var(msg, begin_pos_ref, end_pos_ref, parsed_var_ref) + } -> std::same_as; + + /** + * Adds a substring of `msg` to the constant part of the logtype. + * @param msg The value containing a constant to add to the logtype. + * @param begin_pos The starting offset into `msg` to add to the logtype. + * @param length The length of the substring to add to the logtype. + */ + { + entry.add_constant(msg, begin_pos, length) + } -> std::same_as; + + /** + * Adds an integer variable placeholder to the constant part of the logtype. + */ + { + entry.add_int_var() + } -> std::same_as; + + /** + * Adds a float variable placeholder to the constant part of the logtype. + */ + { + entry.add_float_var() + } -> std::same_as; + + /** + * Adds a dictionary variable placeholder to the constant part of the logtype. + */ + { + entry.add_dictionary_var() + } -> std::same_as; + + /** + * @return The constant part of the logtype. + */ + { + entry.get_value() + } -> std::same_as; + + /** + * @return The number of variables in the constant part of the logtype. + */ + { + entry.get_num_variables() + } -> std::same_as; + + /** + * @return The number of variable placeholders (including escaped ones) in the constant part of + * the logtype. + */ + { + entry.get_num_placeholders() + } -> std::same_as; + + /** + * Gets the position and type of a variable placeholder in the logtype. + * @param placeholder_ix The index of the placeholder to get the info for. + * @param placeholder_ref The type of the placeholder at `placeholder_ix`. + * @return The placeholder's position in the logtype, or `SIZE_MAX` if `placeholder_ix` is out + * of bounds. + */ + { + entry.get_placeholder_info(placeholder_ix, placeholder_ref) + } -> std::same_as; + + /** + * @return The dictionary Id for this logtype. + */ + { + entry.get_id() + } -> std::same_as; +}; + +/** + * Requirement for the variable dictionary entry interface. + * @tparam VariableDictionaryEntryType The type of the variable dictionary entry. + */ +template +concept VariableDictionaryEntryReq = requires(VariableDictionaryEntryType entry) { + /** + * @return The dictionary Id for this variable. + */ + { + entry.get_id() + } -> std::same_as; +}; + +/** + * Requirement for the logtype dictionary reader interface. + * @tparam LogTypeDictionaryReaderType The type of the logtype dictionary reader. + * @tparam LogTypeDictionaryEntryType The type of the entries in the logtype dictionary reader. + */ +template < + typename LogTypeDictionaryReaderType, + typename LogTypeDictionaryEntryType = LogTypeDictionaryReaderType::entry_t> +concept LogTypeDictionaryReaderReq = requires( + LogTypeDictionaryReaderType reader, + std::string_view logtype, + bool ignore_case, + std::unordered_set& entries +) { + /** + * Gets entries matching a given logtype. + * @param logtype + * @param ignore_case Whether the lookup should be case insensitive. + * @return A vector of entries matching the given logtype. + */ + { + reader.get_entry_matching_value(logtype, ignore_case) + } -> std::same_as>; + + /** + * Gets entries matching a wildcard string. + * @param logtype A wildcard search string. + * @param ignore_case Whether the search should be case insensitive. + * @param entries A hash set in which to store the found entries. + */ + { + reader.get_entries_matching_wildcard_string(logtype, ignore_case, entries) + } -> std::same_as; + + std::same_as; + + std::same_as; +}; + +/** + * Requirement for the variable dictionary writer interface. + * @tparam VariableDictionaryWriterType The type of the variable dictionary writer. + */ +template +concept VariableDictionaryWriterReq = requires( + VariableDictionaryWriterType writer, + std::string_view value, + variable_dictionary_id_t id +) { + /** + * Adds the given variable to the dictionary if it doesn't exist. + * @param value + * @param id The Id of the variable matching the given entry. + */ + { + writer.add_entry(value, id) + } -> std::same_as; +}; + +/** + * Requirement for the variable dictionary reader interface. + * @tparam VariableDictionaryReaderType The type of the variable dictionary reader. + * @tparam VariableDictionaryEntryType The type of the entries in the variable dictionary reader. + */ +template < + typename VariableDictionaryReaderType, + typename VariableDictionaryEntryType = VariableDictionaryReaderType::entry_t> +concept VariableDictionaryReaderReq = requires( + VariableDictionaryReaderType reader, + variable_dictionary_id_t id, + std::string_view variable, + bool ignore_case, + std::unordered_set& entries +) { + /** + * @param id + * @return The value of the dictionary entry with the given Id. + */ + { + reader.get_value(id) + } -> std::same_as; + + /** + * Gets entries matching a given variable value. + * @param variable The variable value to look up. + * @param ignore_case Whether the lookup should be case insensitive. + * @return A vector of entries matching the given variable value. + */ + { + reader.get_entry_matching_value(variable, ignore_case) + } -> std::same_as>; + + /** + * Gets entries matching a given wildcard string. + * @param variable A wildcard search string. + * @param ignore_case Whether the search should be case insensitive. + * @param entries A hash set in which to store the found entries. + */ + { + reader.get_entries_matching_wildcard_string(variable, ignore_case, entries) + } -> std::same_as; + + std::same_as; + + std::same_as; +}; +} // namespace clp + +#endif // CLP_DICTIONARYCONCEPTS_HPP From 6ed6d74e6ea1d0c73b75c979aecc2ae8b66f135d Mon Sep 17 00:00:00 2001 From: gibber9809 Date: Tue, 26 Aug 2025 19:20:19 +0000 Subject: [PATCH 02/14] Use dictionary concepts in EncodedVariableInterpreter.hpp --- components/core/CMakeLists.txt | 1 + .../src/clp/EncodedVariableInterpreter.hpp | 54 ++++++++++++------- components/core/src/clp/clg/CMakeLists.txt | 1 + components/core/src/clp/clo/CMakeLists.txt | 1 + components/core/src/clp/clp/CMakeLists.txt | 1 + components/core/src/clp_s/CMakeLists.txt | 1 + .../core/src/clp_s/indexer/CMakeLists.txt | 1 + 7 files changed, 41 insertions(+), 19 deletions(-) diff --git a/components/core/CMakeLists.txt b/components/core/CMakeLists.txt index 6761324359..a9b2cf9b12 100644 --- a/components/core/CMakeLists.txt +++ b/components/core/CMakeLists.txt @@ -473,6 +473,7 @@ set(SOURCE_FILES_unitTest src/clp/Defs.h src/clp/dictionary_utils.cpp src/clp/dictionary_utils.hpp + src/clp/DictionaryConcepts.hpp src/clp/DictionaryEntry.hpp src/clp/DictionaryReader.hpp src/clp/DictionaryWriter.hpp diff --git a/components/core/src/clp/EncodedVariableInterpreter.hpp b/components/core/src/clp/EncodedVariableInterpreter.hpp index 3c93a2cf4f..0737419eef 100644 --- a/components/core/src/clp/EncodedVariableInterpreter.hpp +++ b/components/core/src/clp/EncodedVariableInterpreter.hpp @@ -6,6 +6,7 @@ #include #include +#include "DictionaryConcepts.hpp" #include "ffi/ir_stream/decoding_methods.hpp" #include "ir/LogEvent.hpp" #include "ir/types.hpp" @@ -121,7 +122,9 @@ class EncodedVariableInterpreter { * @param encoded_vars * @param var_ids */ - template + template < + LogTypeDictionaryEntryReq LogTypeDictionaryEntryType, + VariableDictionaryWriterReq VariableDictionaryWriterType> static void encode_and_add_to_dictionary( std::string_view message, LogTypeDictionaryEntryType& logtype_dict_entry, @@ -147,8 +150,8 @@ class EncodedVariableInterpreter { */ template < typename EncodedVariableType, - typename LogTypeDictionaryEntryType, - typename VariableDictionaryWriterType> + LogTypeDictionaryEntryReq LogTypeDictionaryEntryType, + VariableDictionaryWriterReq VariableDictionaryWriterType> static void encode_and_add_to_dictionary( ir::LogEvent const& log_event, LogTypeDictionaryEntryType& logtype_dict_entry, @@ -170,8 +173,8 @@ class EncodedVariableInterpreter { * @return true if successful, false otherwise */ template < - typename LogTypeDictionaryEntryType, - typename VariableDictionaryReaderType, + LogTypeDictionaryEntryReq LogTypeDictionaryEntryType, + VariableDictionaryReaderReq VariableDictionaryReaderType, typename EncodedVariableContainerType> static bool decode_variables_into_message( LogTypeDictionaryEntryType const& logtype_dict_entry, @@ -193,7 +196,7 @@ class EncodedVariableInterpreter { * dictionary * @return false otherwise */ - template + template static bool encode_and_search_dictionary( std::string_view var_str, VariableDictionaryReaderType const& var_dict, @@ -213,8 +216,9 @@ class EncodedVariableInterpreter { * @return true if any match found, false otherwise */ template < - typename VariableDictionaryReaderType, - typename VariableDictionaryEntryType = typename VariableDictionaryReaderType::entry_t> + VariableDictionaryReaderReq VariableDictionaryReaderType, + VariableDictionaryEntryReq VariableDictionaryEntryType + = typename VariableDictionaryReaderType::entry_t> static bool wildcard_search_dictionary_and_get_encoded_matches( std::string_view var_wildcard_str, VariableDictionaryReaderType const& var_dict, @@ -235,7 +239,9 @@ class EncodedVariableInterpreter { * variable) * @return The encoded variable */ - template + template < + LogTypeDictionaryEntryReq LogTypeDictionaryEntryType, + VariableDictionaryWriterReq VariableDictionaryWriterType> static encoded_variable_t encode_var( std::string_view var, LogTypeDictionaryEntryType& logtype_dict_entry, @@ -254,7 +260,9 @@ class EncodedVariableInterpreter { * @param var_ids A container to add the dictionary ID to * @return The dictionary ID */ - template + template < + LogTypeDictionaryEntryReq LogTypeDictionaryEntryType, + VariableDictionaryWriterReq VariableDictionaryWriterType> static variable_dictionary_id_t add_dict_var( std::string_view var, LogTypeDictionaryEntryType& logtype_dict_entry, @@ -263,7 +271,9 @@ class EncodedVariableInterpreter { ); }; -template +template < + LogTypeDictionaryEntryReq LogTypeDictionaryEntryType, + VariableDictionaryWriterReq VariableDictionaryWriterType> void EncodedVariableInterpreter::encode_and_add_to_dictionary( std::string_view message, LogTypeDictionaryEntryType& logtype_dict_entry, @@ -287,8 +297,8 @@ void EncodedVariableInterpreter::encode_and_add_to_dictionary( template < typename EncodedVariableType, - typename LogTypeDictionaryEntryType, - typename VariableDictionaryWriterType> + LogTypeDictionaryEntryReq LogTypeDictionaryEntryType, + VariableDictionaryWriterReq VariableDictionaryWriterType> void EncodedVariableInterpreter::encode_and_add_to_dictionary( ir::LogEvent const& log_event, LogTypeDictionaryEntryType& logtype_dict_entry, @@ -360,8 +370,8 @@ void EncodedVariableInterpreter::encode_and_add_to_dictionary( } template < - typename LogTypeDictionaryEntryType, - typename VariableDictionaryReaderType, + LogTypeDictionaryEntryReq LogTypeDictionaryEntryType, + VariableDictionaryReaderReq VariableDictionaryReaderType, typename EncodedVariableContainerType> bool EncodedVariableInterpreter::decode_variables_into_message( LogTypeDictionaryEntryType const& logtype_dict_entry, @@ -434,7 +444,7 @@ bool EncodedVariableInterpreter::decode_variables_into_message( return true; } -template +template bool EncodedVariableInterpreter::encode_and_search_dictionary( std::string_view var_str, VariableDictionaryReaderType const& var_dict, @@ -482,7 +492,9 @@ bool EncodedVariableInterpreter::encode_and_search_dictionary( return true; } -template +template < + VariableDictionaryReaderReq VariableDictionaryReaderType, + VariableDictionaryEntryReq VariableDictionaryEntryType> bool EncodedVariableInterpreter::wildcard_search_dictionary_and_get_encoded_matches( std::string_view var_wildcard_str, VariableDictionaryReaderType const& var_dict, @@ -510,7 +522,9 @@ bool EncodedVariableInterpreter::wildcard_search_dictionary_and_get_encoded_matc return true; } -template +template < + LogTypeDictionaryEntryReq LogTypeDictionaryEntryType, + VariableDictionaryWriterReq VariableDictionaryWriterType> encoded_variable_t EncodedVariableInterpreter::encode_var( std::string_view var, LogTypeDictionaryEntryType& logtype_dict_entry, @@ -529,7 +543,9 @@ encoded_variable_t EncodedVariableInterpreter::encode_var( return encoded_var; } -template +template < + LogTypeDictionaryEntryReq LogTypeDictionaryEntryType, + VariableDictionaryWriterReq VariableDictionaryWriterType> variable_dictionary_id_t EncodedVariableInterpreter::add_dict_var( std::string_view var, LogTypeDictionaryEntryType& logtype_dict_entry, diff --git a/components/core/src/clp/clg/CMakeLists.txt b/components/core/src/clp/clg/CMakeLists.txt index d96f240b67..a93f03b9c2 100644 --- a/components/core/src/clp/clg/CMakeLists.txt +++ b/components/core/src/clp/clg/CMakeLists.txt @@ -7,6 +7,7 @@ set( ../Defs.h ../dictionary_utils.cpp ../dictionary_utils.hpp + ../DictionaryConcepts.hpp ../DictionaryEntry.hpp ../DictionaryReader.hpp ../EncodedVariableInterpreter.cpp diff --git a/components/core/src/clp/clo/CMakeLists.txt b/components/core/src/clp/clo/CMakeLists.txt index d53fe21d1f..0e5006594c 100644 --- a/components/core/src/clp/clo/CMakeLists.txt +++ b/components/core/src/clp/clo/CMakeLists.txt @@ -11,6 +11,7 @@ set( ../Defs.h ../dictionary_utils.cpp ../dictionary_utils.hpp + ../DictionaryConcepts.hpp ../DictionaryEntry.hpp ../DictionaryReader.hpp ../EncodedVariableInterpreter.cpp diff --git a/components/core/src/clp/clp/CMakeLists.txt b/components/core/src/clp/clp/CMakeLists.txt index c0bf965a61..778d322db6 100644 --- a/components/core/src/clp/clp/CMakeLists.txt +++ b/components/core/src/clp/clp/CMakeLists.txt @@ -10,6 +10,7 @@ set( ../Defs.h ../dictionary_utils.cpp ../dictionary_utils.hpp + ../DictionaryConcepts.hpp ../DictionaryEntry.hpp ../DictionaryReader.hpp ../DictionaryWriter.hpp diff --git a/components/core/src/clp_s/CMakeLists.txt b/components/core/src/clp_s/CMakeLists.txt index 840d90c2ee..b250e483e3 100644 --- a/components/core/src/clp_s/CMakeLists.txt +++ b/components/core/src/clp_s/CMakeLists.txt @@ -17,6 +17,7 @@ set( ../clp/cli_utils.cpp ../clp/cli_utils.hpp ../clp/Defs.h + ../clp/DictionaryConcepts.hpp ../clp/EncodedVariableInterpreter.cpp ../clp/EncodedVariableInterpreter.hpp ../clp/ErrorCode.hpp diff --git a/components/core/src/clp_s/indexer/CMakeLists.txt b/components/core/src/clp_s/indexer/CMakeLists.txt index e63b4021fe..1f5077d8a0 100644 --- a/components/core/src/clp_s/indexer/CMakeLists.txt +++ b/components/core/src/clp_s/indexer/CMakeLists.txt @@ -14,6 +14,7 @@ set( ../../clp/database_utils.cpp ../../clp/database_utils.hpp ../../clp/Defs.h + ../../clp/DictionaryConcepts.hpp ../../clp/EncodedVariableInterpreter.cpp ../../clp/EncodedVariableInterpreter.hpp ../../clp/ErrorCode.hpp From e9dbd7137f913652c7ccbc3d94dc9f46891fe4b3 Mon Sep 17 00:00:00 2001 From: gibber9809 Date: Tue, 26 Aug 2025 19:30:08 +0000 Subject: [PATCH 03/14] Use dictionary concepts in GrepCore.hpp --- components/core/src/clp/GrepCore.hpp | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/components/core/src/clp/GrepCore.hpp b/components/core/src/clp/GrepCore.hpp index 042d8f14a1..caf9805898 100644 --- a/components/core/src/clp/GrepCore.hpp +++ b/components/core/src/clp/GrepCore.hpp @@ -14,6 +14,7 @@ #include #include "Defs.h" +#include "DictionaryConcepts.hpp" #include "EncodedVariableInterpreter.hpp" #include "ir/parsing.hpp" #include "ir/types.hpp" @@ -42,7 +43,9 @@ class GrepCore { * @param use_heuristic * @return Query if it may match a message, std::nullopt otherwise */ - template + template < + LogTypeDictionaryReaderReq LogTypeDictionaryReaderType, + VariableDictionaryReaderReq VariableDictionaryReaderType> static std::optional process_raw_query( LogTypeDictionaryReaderType const& logtype_dict, VariableDictionaryReaderType const& var_dict, @@ -107,7 +110,7 @@ class GrepCore { * @param logtype * @return true if this token might match a message, false otherwise */ - template + template static bool process_var_token( QueryToken const& query_token, VariableDictionaryReaderType const& var_dict, @@ -132,9 +135,10 @@ class GrepCore { * @return SubQueryMatchabilityResult::MayMatch */ template < - typename LogTypeDictionaryReaderType, - typename VariableDictionaryReaderType, - typename LogTypeDictionaryEntryType = typename LogTypeDictionaryReaderType::entry_t> + LogTypeDictionaryReaderReq LogTypeDictionaryReaderType, + VariableDictionaryReaderReq VariableDictionaryReaderType, + LogTypeDictionaryEntryReq LogTypeDictionaryEntryType + = typename LogTypeDictionaryReaderType::entry_t> static SubQueryMatchabilityResult generate_logtypes_and_vars_for_subquery( LogTypeDictionaryReaderType const& logtype_dict, VariableDictionaryReaderType const& var_dict, @@ -145,7 +149,9 @@ class GrepCore { ); }; -template +template < + LogTypeDictionaryReaderReq LogTypeDictionaryReaderType, + VariableDictionaryReaderReq VariableDictionaryReaderType> std::optional GrepCore::process_raw_query( LogTypeDictionaryReaderType const& logtype_dict, VariableDictionaryReaderType const& var_dict, @@ -266,7 +272,7 @@ std::optional GrepCore::process_raw_query( }; } -template +template bool GrepCore::process_var_token( QueryToken const& query_token, VariableDictionaryReaderType const& var_dict, @@ -328,9 +334,9 @@ bool GrepCore::process_var_token( } template < - typename LogTypeDictionaryReaderType, - typename VariableDictionaryReaderType, - typename LogTypeDictionaryEntryType> + LogTypeDictionaryReaderReq LogTypeDictionaryReaderType, + VariableDictionaryReaderReq VariableDictionaryReaderType, + LogTypeDictionaryEntryReq LogTypeDictionaryEntryType> GrepCore::SubQueryMatchabilityResult GrepCore::generate_logtypes_and_vars_for_subquery( LogTypeDictionaryReaderType const& logtype_dict, VariableDictionaryReaderType const& var_dict, From 0131b2d4360cc7d1f3fdab124e0081c15fa8908e Mon Sep 17 00:00:00 2001 From: gibber9809 Date: Tue, 26 Aug 2025 20:19:33 +0000 Subject: [PATCH 04/14] Address rabbit comments. --- .../core/src/clp/DictionaryConcepts.hpp | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/components/core/src/clp/DictionaryConcepts.hpp b/components/core/src/clp/DictionaryConcepts.hpp index 912861420b..7f1a81f1d2 100644 --- a/components/core/src/clp/DictionaryConcepts.hpp +++ b/components/core/src/clp/DictionaryConcepts.hpp @@ -152,7 +152,7 @@ concept VariableDictionaryEntryReq = requires(VariableDictionaryEntryType entry) */ template < typename LogTypeDictionaryReaderType, - typename LogTypeDictionaryEntryType = LogTypeDictionaryReaderType::entry_t> + typename LogTypeDictionaryEntryType = typename LogTypeDictionaryReaderType::entry_t> concept LogTypeDictionaryReaderReq = requires( LogTypeDictionaryReaderType reader, std::string_view logtype, @@ -179,9 +179,11 @@ concept LogTypeDictionaryReaderReq = requires( reader.get_entries_matching_wildcard_string(logtype, ignore_case, entries) } -> std::same_as; - std::same_as; + requires std:: + same_as; - std::same_as; + requires std:: + same_as; }; /** @@ -192,15 +194,16 @@ template concept VariableDictionaryWriterReq = requires( VariableDictionaryWriterType writer, std::string_view value, - variable_dictionary_id_t id + variable_dictionary_id_t& id_ref ) { /** * Adds the given variable to the dictionary if it doesn't exist. * @param value - * @param id The Id of the variable matching the given entry. + * @param id_ref The Id of the variable matching the given entry. + * @return Whether this call resulted in inserting a new entry or not. */ { - writer.add_entry(value, id) + writer.add_entry(value, id_ref) } -> std::same_as; }; @@ -211,7 +214,7 @@ concept VariableDictionaryWriterReq = requires( */ template < typename VariableDictionaryReaderType, - typename VariableDictionaryEntryType = VariableDictionaryReaderType::entry_t> + typename VariableDictionaryEntryType = typename VariableDictionaryReaderType::entry_t> concept VariableDictionaryReaderReq = requires( VariableDictionaryReaderType reader, variable_dictionary_id_t id, @@ -247,9 +250,12 @@ concept VariableDictionaryReaderReq = requires( reader.get_entries_matching_wildcard_string(variable, ignore_case, entries) } -> std::same_as; - std::same_as; + requires std::same_as< + typename VariableDictionaryReaderType::dictionary_id_t, + variable_dictionary_id_t>; - std::same_as; + requires std:: + same_as; }; } // namespace clp From 7da8133644bccc77645b77d0cde743142da262bd Mon Sep 17 00:00:00 2001 From: gibber9809 Date: Tue, 26 Aug 2025 20:19:57 +0000 Subject: [PATCH 05/14] Fix instance of clp-s dictionary readers not following dictionary concepts --- components/core/src/clp_s/DictionaryReader.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/core/src/clp_s/DictionaryReader.hpp b/components/core/src/clp_s/DictionaryReader.hpp index e5a8a92829..4c9248f191 100644 --- a/components/core/src/clp_s/DictionaryReader.hpp +++ b/components/core/src/clp_s/DictionaryReader.hpp @@ -12,6 +12,7 @@ #include #include +#include "../clp/Defs.h" #include "ArchiveReaderAdaptor.hpp" #include "DictionaryEntry.hpp" #include "Utils.hpp" @@ -97,8 +98,10 @@ class DictionaryReader { std::vector m_entries; }; -using VariableDictionaryReader = DictionaryReader; -using LogTypeDictionaryReader = DictionaryReader; +using VariableDictionaryReader + = DictionaryReader; +using LogTypeDictionaryReader + = DictionaryReader; template void DictionaryReader::open(std::string const& dictionary_path) { From d8d81f8774a0aad50393417f5300224fcaf5b9e0 Mon Sep 17 00:00:00 2001 From: Devin Gibson Date: Mon, 15 Sep 2025 11:06:38 -0400 Subject: [PATCH 06/14] Apply suggestions from code review Co-authored-by: Lin Zhihao <59785146+LinZhihao-723@users.noreply.github.com> --- .../core/src/clp/DictionaryConcepts.hpp | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/components/core/src/clp/DictionaryConcepts.hpp b/components/core/src/clp/DictionaryConcepts.hpp index 7f1a81f1d2..26056d06ba 100644 --- a/components/core/src/clp/DictionaryConcepts.hpp +++ b/components/core/src/clp/DictionaryConcepts.hpp @@ -49,11 +49,12 @@ concept LogTypeDictionaryEntryReq = requires( * constructing the constant part of the message's logtype in the processed range at the same * time. * @param msg The original log message. - * @param begin_pos_ref The beginning position of the last variable. This parameter is updated - * to the beginning position of the next variable. - * @param end_pos_ref The ending position of the last variable (exclusive). This parameter is - * updated to the ending position of the next variable (exclusive). - * @return Whether another variable was found or not. + * @param begin_pos_ref The beginning position of the last variable. Returns the beginning + * position of the next variable. + * @param end_pos_ref The ending position of the last variable (exclusive). Returns the ending + * position of the next variable (exclusive). + * @param parsed_var_ref Returns a view to the parsed variable, if one was found. + * @return Whether a new variable was parsed. */ { entry.parse_next_var(msg, begin_pos_ref, end_pos_ref, parsed_var_ref) @@ -115,7 +116,7 @@ concept LogTypeDictionaryEntryReq = requires( /** * Gets the position and type of a variable placeholder in the logtype. * @param placeholder_ix The index of the placeholder to get the info for. - * @param placeholder_ref The type of the placeholder at `placeholder_ix`. + * @param placeholder_ref Returns the type of the placeholder at `placeholder_ix`. * @return The placeholder's position in the logtype, or `SIZE_MAX` if `placeholder_ix` is out * of bounds. */ @@ -124,7 +125,7 @@ concept LogTypeDictionaryEntryReq = requires( } -> std::same_as; /** - * @return The dictionary Id for this logtype. + * @return The dictionary ID for this logtype. */ { entry.get_id() @@ -138,7 +139,7 @@ concept LogTypeDictionaryEntryReq = requires( template concept VariableDictionaryEntryReq = requires(VariableDictionaryEntryType entry) { /** - * @return The dictionary Id for this variable. + * @return The dictionary ID for this variable. */ { entry.get_id() @@ -162,7 +163,7 @@ concept LogTypeDictionaryReaderReq = requires( /** * Gets entries matching a given logtype. * @param logtype - * @param ignore_case Whether the lookup should be case insensitive. + * @param ignore_case Whether the search should be case insensitive. * @return A vector of entries matching the given logtype. */ { @@ -173,7 +174,7 @@ concept LogTypeDictionaryReaderReq = requires( * Gets entries matching a wildcard string. * @param logtype A wildcard search string. * @param ignore_case Whether the search should be case insensitive. - * @param entries A hash set in which to store the found entries. + * @param entries Returns all the matching entries. */ { reader.get_entries_matching_wildcard_string(logtype, ignore_case, entries) @@ -199,8 +200,8 @@ concept VariableDictionaryWriterReq = requires( /** * Adds the given variable to the dictionary if it doesn't exist. * @param value - * @param id_ref The Id of the variable matching the given entry. - * @return Whether this call resulted in inserting a new entry or not. + * @param id_ref Returns the entry ID of the given variable. + * @return Whether this call resulted in inserting a new entry. */ { writer.add_entry(value, id_ref) @@ -233,7 +234,7 @@ concept VariableDictionaryReaderReq = requires( /** * Gets entries matching a given variable value. * @param variable The variable value to look up. - * @param ignore_case Whether the lookup should be case insensitive. + * @param ignore_case Whether the search should be case insensitive. * @return A vector of entries matching the given variable value. */ { @@ -244,7 +245,7 @@ concept VariableDictionaryReaderReq = requires( * Gets entries matching a given wildcard string. * @param variable A wildcard search string. * @param ignore_case Whether the search should be case insensitive. - * @param entries A hash set in which to store the found entries. + * @param entries Returns all the matching entries. */ { reader.get_entries_matching_wildcard_string(variable, ignore_case, entries) From 454daba775b25b977244883b2e162ff7defd2e1f Mon Sep 17 00:00:00 2001 From: gibber9809 Date: Mon, 15 Sep 2025 15:27:54 +0000 Subject: [PATCH 07/14] Apply some review comments. --- .../core/src/clp/DictionaryConcepts.hpp | 27 +++++++------------ 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/components/core/src/clp/DictionaryConcepts.hpp b/components/core/src/clp/DictionaryConcepts.hpp index 26056d06ba..ad8e63e36b 100644 --- a/components/core/src/clp/DictionaryConcepts.hpp +++ b/components/core/src/clp/DictionaryConcepts.hpp @@ -149,17 +149,16 @@ concept VariableDictionaryEntryReq = requires(VariableDictionaryEntryType entry) /** * Requirement for the logtype dictionary reader interface. * @tparam LogTypeDictionaryReaderType The type of the logtype dictionary reader. - * @tparam LogTypeDictionaryEntryType The type of the entries in the logtype dictionary reader. */ -template < - typename LogTypeDictionaryReaderType, - typename LogTypeDictionaryEntryType = typename LogTypeDictionaryReaderType::entry_t> +template concept LogTypeDictionaryReaderReq = requires( LogTypeDictionaryReaderType reader, std::string_view logtype, bool ignore_case, - std::unordered_set& entries + std::unordered_set& entries ) { + requires LogTypeDictionaryEntryReq; + /** * Gets entries matching a given logtype. * @param logtype @@ -168,7 +167,7 @@ concept LogTypeDictionaryReaderReq = requires( */ { reader.get_entry_matching_value(logtype, ignore_case) - } -> std::same_as>; + } -> std::same_as>; /** * Gets entries matching a wildcard string. @@ -182,9 +181,6 @@ concept LogTypeDictionaryReaderReq = requires( requires std:: same_as; - - requires std:: - same_as; }; /** @@ -213,16 +209,16 @@ concept VariableDictionaryWriterReq = requires( * @tparam VariableDictionaryReaderType The type of the variable dictionary reader. * @tparam VariableDictionaryEntryType The type of the entries in the variable dictionary reader. */ -template < - typename VariableDictionaryReaderType, - typename VariableDictionaryEntryType = typename VariableDictionaryReaderType::entry_t> +template concept VariableDictionaryReaderReq = requires( VariableDictionaryReaderType reader, variable_dictionary_id_t id, std::string_view variable, bool ignore_case, - std::unordered_set& entries + std::unordered_set& entries ) { + requires VariableDictionaryEntryReq; + /** * @param id * @return The value of the dictionary entry with the given Id. @@ -239,7 +235,7 @@ concept VariableDictionaryReaderReq = requires( */ { reader.get_entry_matching_value(variable, ignore_case) - } -> std::same_as>; + } -> std::same_as>; /** * Gets entries matching a given wildcard string. @@ -254,9 +250,6 @@ concept VariableDictionaryReaderReq = requires( requires std::same_as< typename VariableDictionaryReaderType::dictionary_id_t, variable_dictionary_id_t>; - - requires std:: - same_as; }; } // namespace clp From eb6e7464cd715427be46103d2083561ffc56a3c0 Mon Sep 17 00:00:00 2001 From: gibber9809 Date: Mon, 15 Sep 2025 15:37:15 +0000 Subject: [PATCH 08/14] Simplify some templates --- .../core/src/clp/EncodedVariableInterpreter.hpp | 12 +++--------- components/core/src/clp/GrepCore.hpp | 11 ++++------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/components/core/src/clp/EncodedVariableInterpreter.hpp b/components/core/src/clp/EncodedVariableInterpreter.hpp index ed5f6855a6..a8b64e657f 100644 --- a/components/core/src/clp/EncodedVariableInterpreter.hpp +++ b/components/core/src/clp/EncodedVariableInterpreter.hpp @@ -210,17 +210,13 @@ class EncodedVariableInterpreter { * Search for the given string-form variable in the variable dictionary, encode any matches, and * add them to the given sub-query. * @tparam VariableDictionaryReaderType - * @tparam VariableDictionaryEntryType * @param var_wildcard_str * @param var_dict * @param ignore_case * @param sub_query * @return true if any match found, false otherwise */ - template < - VariableDictionaryReaderReq VariableDictionaryReaderType, - VariableDictionaryEntryReq VariableDictionaryEntryType - = typename VariableDictionaryReaderType::entry_t> + template static bool wildcard_search_dictionary_and_get_encoded_matches( std::string_view var_wildcard_str, VariableDictionaryReaderType const& var_dict, @@ -495,9 +491,7 @@ bool EncodedVariableInterpreter::encode_and_search_dictionary( return true; } -template < - VariableDictionaryReaderReq VariableDictionaryReaderType, - VariableDictionaryEntryReq VariableDictionaryEntryType> +template bool EncodedVariableInterpreter::wildcard_search_dictionary_and_get_encoded_matches( std::string_view var_wildcard_str, VariableDictionaryReaderType const& var_dict, @@ -505,7 +499,7 @@ bool EncodedVariableInterpreter::wildcard_search_dictionary_and_get_encoded_matc SubQuery& sub_query ) { // Find matches - std::unordered_set var_dict_entries; + std::unordered_set var_dict_entries; var_dict.get_entries_matching_wildcard_string(var_wildcard_str, ignore_case, var_dict_entries); if (var_dict_entries.empty()) { // Not in dictionary diff --git a/components/core/src/clp/GrepCore.hpp b/components/core/src/clp/GrepCore.hpp index caf9805898..e0b62b1c3d 100644 --- a/components/core/src/clp/GrepCore.hpp +++ b/components/core/src/clp/GrepCore.hpp @@ -123,7 +123,6 @@ class GrepCore { * Generates logtypes and variables for subquery. * @tparam LogTypeDictionaryReaderType * @tparam VariableDictionaryReaderType - * @tparam LogTypeDictionaryEntryType * @param logtype_dict * @param var_dict * @param processed_search_string @@ -136,9 +135,7 @@ class GrepCore { */ template < LogTypeDictionaryReaderReq LogTypeDictionaryReaderType, - VariableDictionaryReaderReq VariableDictionaryReaderType, - LogTypeDictionaryEntryReq LogTypeDictionaryEntryType - = typename LogTypeDictionaryReaderType::entry_t> + VariableDictionaryReaderReq VariableDictionaryReaderType> static SubQueryMatchabilityResult generate_logtypes_and_vars_for_subquery( LogTypeDictionaryReaderType const& logtype_dict, VariableDictionaryReaderType const& var_dict, @@ -335,8 +332,7 @@ bool GrepCore::process_var_token( template < LogTypeDictionaryReaderReq LogTypeDictionaryReaderType, - VariableDictionaryReaderReq VariableDictionaryReaderType, - LogTypeDictionaryEntryReq LogTypeDictionaryEntryType> + VariableDictionaryReaderReq VariableDictionaryReaderType> GrepCore::SubQueryMatchabilityResult GrepCore::generate_logtypes_and_vars_for_subquery( LogTypeDictionaryReaderType const& logtype_dict, VariableDictionaryReaderType const& var_dict, @@ -413,7 +409,8 @@ GrepCore::SubQueryMatchabilityResult GrepCore::generate_logtypes_and_vars_for_su } // Find matching logtypes - std::unordered_set possible_logtype_entries; + std::unordered_set + possible_logtype_entries; logtype_dict .get_entries_matching_wildcard_string(logtype, ignore_case, possible_logtype_entries); if (possible_logtype_entries.empty()) { From 0da5e241192c8b7d331fc5c8fbac0135c6abae13 Mon Sep 17 00:00:00 2001 From: gibber9809 Date: Mon, 15 Sep 2025 15:41:19 +0000 Subject: [PATCH 09/14] Remove unused parameter in concept --- components/core/src/clp/DictionaryConcepts.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/core/src/clp/DictionaryConcepts.hpp b/components/core/src/clp/DictionaryConcepts.hpp index ad8e63e36b..b9dff9ad98 100644 --- a/components/core/src/clp/DictionaryConcepts.hpp +++ b/components/core/src/clp/DictionaryConcepts.hpp @@ -26,8 +26,7 @@ concept LogTypeDictionaryEntryReq = requires( std::string_view& parsed_var_ref, size_t begin_pos, size_t placeholder_ix, - ir::VariablePlaceholder& placeholder_ref, - std::string& logtype + ir::VariablePlaceholder& placeholder_ref ) { /** * Clears all internal state. From 0d1e320a26be8d3072e74cc522c0407c6936c522 Mon Sep 17 00:00:00 2001 From: gibber9809 Date: Mon, 15 Sep 2025 15:53:31 +0000 Subject: [PATCH 10/14] Rename entry_t to EntryT --- components/core/src/clp/DictionaryConcepts.hpp | 12 ++++++------ components/core/src/clp/DictionaryReader.hpp | 2 +- components/core/src/clp/DictionaryWriter.hpp | 2 +- .../core/src/clp/EncodedVariableInterpreter.hpp | 2 +- components/core/src/clp/GrepCore.hpp | 2 +- components/core/src/clp_s/DictionaryReader.hpp | 2 +- components/core/src/clp_s/DictionaryWriter.hpp | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/components/core/src/clp/DictionaryConcepts.hpp b/components/core/src/clp/DictionaryConcepts.hpp index b9dff9ad98..b4f3c223a2 100644 --- a/components/core/src/clp/DictionaryConcepts.hpp +++ b/components/core/src/clp/DictionaryConcepts.hpp @@ -154,9 +154,9 @@ concept LogTypeDictionaryReaderReq = requires( LogTypeDictionaryReaderType reader, std::string_view logtype, bool ignore_case, - std::unordered_set& entries + std::unordered_set& entries ) { - requires LogTypeDictionaryEntryReq; + requires LogTypeDictionaryEntryReq; /** * Gets entries matching a given logtype. @@ -166,7 +166,7 @@ concept LogTypeDictionaryReaderReq = requires( */ { reader.get_entry_matching_value(logtype, ignore_case) - } -> std::same_as>; + } -> std::same_as>; /** * Gets entries matching a wildcard string. @@ -214,9 +214,9 @@ concept VariableDictionaryReaderReq = requires( variable_dictionary_id_t id, std::string_view variable, bool ignore_case, - std::unordered_set& entries + std::unordered_set& entries ) { - requires VariableDictionaryEntryReq; + requires VariableDictionaryEntryReq; /** * @param id @@ -234,7 +234,7 @@ concept VariableDictionaryReaderReq = requires( */ { reader.get_entry_matching_value(variable, ignore_case) - } -> std::same_as>; + } -> std::same_as>; /** * Gets entries matching a given wildcard string. diff --git a/components/core/src/clp/DictionaryReader.hpp b/components/core/src/clp/DictionaryReader.hpp index 7e8f3a3a16..8340bf70f5 100644 --- a/components/core/src/clp/DictionaryReader.hpp +++ b/components/core/src/clp/DictionaryReader.hpp @@ -38,7 +38,7 @@ class DictionaryReader { }; using dictionary_id_t = DictionaryIdType; - using entry_t = EntryType; + using EntryT = EntryType; // Constructors DictionaryReader() : m_is_open(false), m_num_segments_read_from_index(0) { diff --git a/components/core/src/clp/DictionaryWriter.hpp b/components/core/src/clp/DictionaryWriter.hpp index 280a2ae3dd..37120a923f 100644 --- a/components/core/src/clp/DictionaryWriter.hpp +++ b/components/core/src/clp/DictionaryWriter.hpp @@ -36,7 +36,7 @@ class DictionaryWriter { }; using dictionary_id_t = DictionaryIdType; - using entry_t = EntryType; + using EntryT = EntryType; // Constructors DictionaryWriter() : m_is_open(false) {} diff --git a/components/core/src/clp/EncodedVariableInterpreter.hpp b/components/core/src/clp/EncodedVariableInterpreter.hpp index a8b64e657f..45f27f9b8d 100644 --- a/components/core/src/clp/EncodedVariableInterpreter.hpp +++ b/components/core/src/clp/EncodedVariableInterpreter.hpp @@ -499,7 +499,7 @@ bool EncodedVariableInterpreter::wildcard_search_dictionary_and_get_encoded_matc SubQuery& sub_query ) { // Find matches - std::unordered_set var_dict_entries; + std::unordered_set var_dict_entries; var_dict.get_entries_matching_wildcard_string(var_wildcard_str, ignore_case, var_dict_entries); if (var_dict_entries.empty()) { // Not in dictionary diff --git a/components/core/src/clp/GrepCore.hpp b/components/core/src/clp/GrepCore.hpp index e0b62b1c3d..c9c97bd342 100644 --- a/components/core/src/clp/GrepCore.hpp +++ b/components/core/src/clp/GrepCore.hpp @@ -409,7 +409,7 @@ GrepCore::SubQueryMatchabilityResult GrepCore::generate_logtypes_and_vars_for_su } // Find matching logtypes - std::unordered_set + std::unordered_set possible_logtype_entries; logtype_dict .get_entries_matching_wildcard_string(logtype, ignore_case, possible_logtype_entries); diff --git a/components/core/src/clp_s/DictionaryReader.hpp b/components/core/src/clp_s/DictionaryReader.hpp index 39b5a5809b..d7320224fe 100644 --- a/components/core/src/clp_s/DictionaryReader.hpp +++ b/components/core/src/clp_s/DictionaryReader.hpp @@ -29,7 +29,7 @@ class DictionaryReader { }; using dictionary_id_t = DictionaryIdType; - using entry_t = EntryType; + using EntryT = EntryType; // Constructors DictionaryReader(ArchiveReaderAdaptor& adaptor) : m_is_open(false), m_adaptor(adaptor) {} diff --git a/components/core/src/clp_s/DictionaryWriter.hpp b/components/core/src/clp_s/DictionaryWriter.hpp index 0920e8bae9..dcf739da83 100644 --- a/components/core/src/clp_s/DictionaryWriter.hpp +++ b/components/core/src/clp_s/DictionaryWriter.hpp @@ -21,7 +21,7 @@ class DictionaryWriter { }; using dictionary_id_t = DictionaryIdType; - using entry_t = EntryType; + using EntryT = EntryType; // Constructors DictionaryWriter() : m_is_open(false) {} From 29226f1af1c16ea262bd9996f7984c87a5289ae6 Mon Sep 17 00:00:00 2001 From: gibber9809 Date: Mon, 15 Sep 2025 19:07:58 +0000 Subject: [PATCH 11/14] Rename EntryT -> Entry --- components/core/src/clp/DictionaryConcepts.hpp | 12 ++++++------ components/core/src/clp/DictionaryReader.hpp | 2 +- components/core/src/clp/DictionaryWriter.hpp | 2 +- .../core/src/clp/EncodedVariableInterpreter.hpp | 2 +- components/core/src/clp/GrepCore.hpp | 3 +-- components/core/src/clp_s/DictionaryReader.hpp | 2 +- components/core/src/clp_s/DictionaryWriter.hpp | 2 +- 7 files changed, 12 insertions(+), 13 deletions(-) diff --git a/components/core/src/clp/DictionaryConcepts.hpp b/components/core/src/clp/DictionaryConcepts.hpp index b4f3c223a2..89d4c118ab 100644 --- a/components/core/src/clp/DictionaryConcepts.hpp +++ b/components/core/src/clp/DictionaryConcepts.hpp @@ -154,9 +154,9 @@ concept LogTypeDictionaryReaderReq = requires( LogTypeDictionaryReaderType reader, std::string_view logtype, bool ignore_case, - std::unordered_set& entries + std::unordered_set& entries ) { - requires LogTypeDictionaryEntryReq; + requires LogTypeDictionaryEntryReq; /** * Gets entries matching a given logtype. @@ -166,7 +166,7 @@ concept LogTypeDictionaryReaderReq = requires( */ { reader.get_entry_matching_value(logtype, ignore_case) - } -> std::same_as>; + } -> std::same_as>; /** * Gets entries matching a wildcard string. @@ -214,9 +214,9 @@ concept VariableDictionaryReaderReq = requires( variable_dictionary_id_t id, std::string_view variable, bool ignore_case, - std::unordered_set& entries + std::unordered_set& entries ) { - requires VariableDictionaryEntryReq; + requires VariableDictionaryEntryReq; /** * @param id @@ -234,7 +234,7 @@ concept VariableDictionaryReaderReq = requires( */ { reader.get_entry_matching_value(variable, ignore_case) - } -> std::same_as>; + } -> std::same_as>; /** * Gets entries matching a given wildcard string. diff --git a/components/core/src/clp/DictionaryReader.hpp b/components/core/src/clp/DictionaryReader.hpp index 8340bf70f5..b8de10309d 100644 --- a/components/core/src/clp/DictionaryReader.hpp +++ b/components/core/src/clp/DictionaryReader.hpp @@ -38,7 +38,7 @@ class DictionaryReader { }; using dictionary_id_t = DictionaryIdType; - using EntryT = EntryType; + using Entry = EntryType; // Constructors DictionaryReader() : m_is_open(false), m_num_segments_read_from_index(0) { diff --git a/components/core/src/clp/DictionaryWriter.hpp b/components/core/src/clp/DictionaryWriter.hpp index 37120a923f..0b2ed3af47 100644 --- a/components/core/src/clp/DictionaryWriter.hpp +++ b/components/core/src/clp/DictionaryWriter.hpp @@ -36,7 +36,7 @@ class DictionaryWriter { }; using dictionary_id_t = DictionaryIdType; - using EntryT = EntryType; + using Entry = EntryType; // Constructors DictionaryWriter() : m_is_open(false) {} diff --git a/components/core/src/clp/EncodedVariableInterpreter.hpp b/components/core/src/clp/EncodedVariableInterpreter.hpp index 45f27f9b8d..29ad8f0747 100644 --- a/components/core/src/clp/EncodedVariableInterpreter.hpp +++ b/components/core/src/clp/EncodedVariableInterpreter.hpp @@ -499,7 +499,7 @@ bool EncodedVariableInterpreter::wildcard_search_dictionary_and_get_encoded_matc SubQuery& sub_query ) { // Find matches - std::unordered_set var_dict_entries; + std::unordered_set var_dict_entries; var_dict.get_entries_matching_wildcard_string(var_wildcard_str, ignore_case, var_dict_entries); if (var_dict_entries.empty()) { // Not in dictionary diff --git a/components/core/src/clp/GrepCore.hpp b/components/core/src/clp/GrepCore.hpp index c9c97bd342..29bef91d8c 100644 --- a/components/core/src/clp/GrepCore.hpp +++ b/components/core/src/clp/GrepCore.hpp @@ -409,8 +409,7 @@ GrepCore::SubQueryMatchabilityResult GrepCore::generate_logtypes_and_vars_for_su } // Find matching logtypes - std::unordered_set - possible_logtype_entries; + std::unordered_set possible_logtype_entries; logtype_dict .get_entries_matching_wildcard_string(logtype, ignore_case, possible_logtype_entries); if (possible_logtype_entries.empty()) { diff --git a/components/core/src/clp_s/DictionaryReader.hpp b/components/core/src/clp_s/DictionaryReader.hpp index d7320224fe..0256ab053d 100644 --- a/components/core/src/clp_s/DictionaryReader.hpp +++ b/components/core/src/clp_s/DictionaryReader.hpp @@ -29,7 +29,7 @@ class DictionaryReader { }; using dictionary_id_t = DictionaryIdType; - using EntryT = EntryType; + using Entry = EntryType; // Constructors DictionaryReader(ArchiveReaderAdaptor& adaptor) : m_is_open(false), m_adaptor(adaptor) {} diff --git a/components/core/src/clp_s/DictionaryWriter.hpp b/components/core/src/clp_s/DictionaryWriter.hpp index dcf739da83..05a8d094e3 100644 --- a/components/core/src/clp_s/DictionaryWriter.hpp +++ b/components/core/src/clp_s/DictionaryWriter.hpp @@ -21,7 +21,7 @@ class DictionaryWriter { }; using dictionary_id_t = DictionaryIdType; - using EntryT = EntryType; + using Entry = EntryType; // Constructors DictionaryWriter() : m_is_open(false) {} From 80e27c6c970e877b0dace4973be809a3779f7935 Mon Sep 17 00:00:00 2001 From: gibber9809 Date: Mon, 15 Sep 2025 19:08:35 +0000 Subject: [PATCH 12/14] Rename placeholder_ix -> placeholder_idx --- components/core/src/clp/DictionaryConcepts.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/core/src/clp/DictionaryConcepts.hpp b/components/core/src/clp/DictionaryConcepts.hpp index 89d4c118ab..d519ea03a3 100644 --- a/components/core/src/clp/DictionaryConcepts.hpp +++ b/components/core/src/clp/DictionaryConcepts.hpp @@ -25,7 +25,7 @@ concept LogTypeDictionaryEntryReq = requires( size_t& end_pos_ref, std::string_view& parsed_var_ref, size_t begin_pos, - size_t placeholder_ix, + size_t placeholder_idx, ir::VariablePlaceholder& placeholder_ref ) { /** @@ -114,13 +114,13 @@ concept LogTypeDictionaryEntryReq = requires( /** * Gets the position and type of a variable placeholder in the logtype. - * @param placeholder_ix The index of the placeholder to get the info for. - * @param placeholder_ref Returns the type of the placeholder at `placeholder_ix`. - * @return The placeholder's position in the logtype, or `SIZE_MAX` if `placeholder_ix` is out + * @param placeholder_idx The index of the placeholder to get the info for. + * @param placeholder_ref Returns the type of the placeholder at `placeholder_idx`. + * @return The placeholder's position in the logtype, or `SIZE_MAX` if `placeholder_idx` is out * of bounds. */ { - entry.get_placeholder_info(placeholder_ix, placeholder_ref) + entry.get_placeholder_info(placeholder_idx, placeholder_ref) } -> std::same_as; /** From f9cb84c1f761beeb2a23c68ad5357b5e04b7a9a9 Mon Sep 17 00:00:00 2001 From: gibber9809 Date: Wed, 17 Sep 2025 15:27:33 +0000 Subject: [PATCH 13/14] Split new dictionary concepts into dedicated header files. --- components/core/CMakeLists.txt | 6 +- .../core/src/clp/DictionaryConcepts.hpp | 255 ------------------ .../src/clp/EncodedVariableInterpreter.hpp | 4 +- components/core/src/clp/GrepCore.hpp | 3 +- .../src/clp/LogTypeDictionaryEntryReq.hpp | 133 +++++++++ .../src/clp/LogTypeDictionaryReaderReq.hpp | 51 ++++ .../src/clp/VariableDictionaryEntryReq.hpp | 24 ++ .../src/clp/VariableDictionaryReaderReq.hpp | 63 +++++ .../src/clp/VariableDictionaryWriterReq.hpp | 31 +++ components/core/src/clp/clg/CMakeLists.txt | 6 +- components/core/src/clp/clo/CMakeLists.txt | 6 +- components/core/src/clp/clp/CMakeLists.txt | 5 +- components/core/src/clp_s/CMakeLists.txt | 6 +- .../core/src/clp_s/indexer/CMakeLists.txt | 5 +- 14 files changed, 335 insertions(+), 263 deletions(-) delete mode 100644 components/core/src/clp/DictionaryConcepts.hpp create mode 100644 components/core/src/clp/LogTypeDictionaryEntryReq.hpp create mode 100644 components/core/src/clp/LogTypeDictionaryReaderReq.hpp create mode 100644 components/core/src/clp/VariableDictionaryEntryReq.hpp create mode 100644 components/core/src/clp/VariableDictionaryReaderReq.hpp create mode 100644 components/core/src/clp/VariableDictionaryWriterReq.hpp diff --git a/components/core/CMakeLists.txt b/components/core/CMakeLists.txt index d5eb22ff70..c4e381b919 100644 --- a/components/core/CMakeLists.txt +++ b/components/core/CMakeLists.txt @@ -474,7 +474,6 @@ set(SOURCE_FILES_unitTest src/clp/Defs.h src/clp/dictionary_utils.cpp src/clp/dictionary_utils.hpp - src/clp/DictionaryConcepts.hpp src/clp/DictionaryEntry.hpp src/clp/DictionaryReader.hpp src/clp/DictionaryWriter.hpp @@ -583,7 +582,9 @@ set(SOURCE_FILES_unitTest src/clp/LogSurgeonReader.hpp src/clp/LogTypeDictionaryEntry.cpp src/clp/LogTypeDictionaryEntry.hpp + src/clp/LogTypeDictionaryEntryReq.hpp src/clp/LogTypeDictionaryReader.hpp + src/clp/LogTypeDictionaryReaderReq.hpp src/clp/LogTypeDictionaryWriter.cpp src/clp/LogTypeDictionaryWriter.hpp src/clp/math_utils.hpp @@ -676,9 +677,12 @@ set(SOURCE_FILES_unitTest src/clp/Utils.hpp src/clp/VariableDictionaryEntry.cpp src/clp/VariableDictionaryEntry.hpp + src/clp/VariableDictionaryEntryReq.hpp src/clp/VariableDictionaryReader.hpp + src/clp/VariableDictionaryReaderReq.hpp src/clp/VariableDictionaryWriter.cpp src/clp/VariableDictionaryWriter.hpp + src/clp/VariableDictionaryWriterReq.hpp src/clp/version.hpp src/clp/WriterInterface.cpp src/clp/WriterInterface.hpp diff --git a/components/core/src/clp/DictionaryConcepts.hpp b/components/core/src/clp/DictionaryConcepts.hpp deleted file mode 100644 index d519ea03a3..0000000000 --- a/components/core/src/clp/DictionaryConcepts.hpp +++ /dev/null @@ -1,255 +0,0 @@ -#ifndef CLP_DICTIONARYCONCEPTS_HPP -#define CLP_DICTIONARYCONCEPTS_HPP - -#include -#include -#include -#include -#include -#include - -#include "Defs.h" -#include "ir/types.hpp" - -namespace clp { -/** - * Requirement for the logtype dictionary entry interface. - * @tparam LogTypeDictionaryEntryType The type of the logtype dictionary entry. - */ -template -concept LogTypeDictionaryEntryReq = requires( - LogTypeDictionaryEntryType entry, - size_t length, - std::string_view msg, - size_t& begin_pos_ref, - size_t& end_pos_ref, - std::string_view& parsed_var_ref, - size_t begin_pos, - size_t placeholder_idx, - ir::VariablePlaceholder& placeholder_ref -) { - /** - * Clears all internal state. - */ - { - entry.clear() - } -> std::same_as; - - /** - * Reserves space for a logtype string of a given length. - * @param length - */ - { - entry.reserve_constant_length(length) - } -> std::same_as; - - /** - * Parses the next variable from a message according to `ir::get_bounds_of_next_var`, - * constructing the constant part of the message's logtype in the processed range at the same - * time. - * @param msg The original log message. - * @param begin_pos_ref The beginning position of the last variable. Returns the beginning - * position of the next variable. - * @param end_pos_ref The ending position of the last variable (exclusive). Returns the ending - * position of the next variable (exclusive). - * @param parsed_var_ref Returns a view to the parsed variable, if one was found. - * @return Whether a new variable was parsed. - */ - { - entry.parse_next_var(msg, begin_pos_ref, end_pos_ref, parsed_var_ref) - } -> std::same_as; - - /** - * Adds a substring of `msg` to the constant part of the logtype. - * @param msg The value containing a constant to add to the logtype. - * @param begin_pos The starting offset into `msg` to add to the logtype. - * @param length The length of the substring to add to the logtype. - */ - { - entry.add_constant(msg, begin_pos, length) - } -> std::same_as; - - /** - * Adds an integer variable placeholder to the constant part of the logtype. - */ - { - entry.add_int_var() - } -> std::same_as; - - /** - * Adds a float variable placeholder to the constant part of the logtype. - */ - { - entry.add_float_var() - } -> std::same_as; - - /** - * Adds a dictionary variable placeholder to the constant part of the logtype. - */ - { - entry.add_dictionary_var() - } -> std::same_as; - - /** - * @return The constant part of the logtype. - */ - { - entry.get_value() - } -> std::same_as; - - /** - * @return The number of variables in the constant part of the logtype. - */ - { - entry.get_num_variables() - } -> std::same_as; - - /** - * @return The number of variable placeholders (including escaped ones) in the constant part of - * the logtype. - */ - { - entry.get_num_placeholders() - } -> std::same_as; - - /** - * Gets the position and type of a variable placeholder in the logtype. - * @param placeholder_idx The index of the placeholder to get the info for. - * @param placeholder_ref Returns the type of the placeholder at `placeholder_idx`. - * @return The placeholder's position in the logtype, or `SIZE_MAX` if `placeholder_idx` is out - * of bounds. - */ - { - entry.get_placeholder_info(placeholder_idx, placeholder_ref) - } -> std::same_as; - - /** - * @return The dictionary ID for this logtype. - */ - { - entry.get_id() - } -> std::same_as; -}; - -/** - * Requirement for the variable dictionary entry interface. - * @tparam VariableDictionaryEntryType The type of the variable dictionary entry. - */ -template -concept VariableDictionaryEntryReq = requires(VariableDictionaryEntryType entry) { - /** - * @return The dictionary ID for this variable. - */ - { - entry.get_id() - } -> std::same_as; -}; - -/** - * Requirement for the logtype dictionary reader interface. - * @tparam LogTypeDictionaryReaderType The type of the logtype dictionary reader. - */ -template -concept LogTypeDictionaryReaderReq = requires( - LogTypeDictionaryReaderType reader, - std::string_view logtype, - bool ignore_case, - std::unordered_set& entries -) { - requires LogTypeDictionaryEntryReq; - - /** - * Gets entries matching a given logtype. - * @param logtype - * @param ignore_case Whether the search should be case insensitive. - * @return A vector of entries matching the given logtype. - */ - { - reader.get_entry_matching_value(logtype, ignore_case) - } -> std::same_as>; - - /** - * Gets entries matching a wildcard string. - * @param logtype A wildcard search string. - * @param ignore_case Whether the search should be case insensitive. - * @param entries Returns all the matching entries. - */ - { - reader.get_entries_matching_wildcard_string(logtype, ignore_case, entries) - } -> std::same_as; - - requires std:: - same_as; -}; - -/** - * Requirement for the variable dictionary writer interface. - * @tparam VariableDictionaryWriterType The type of the variable dictionary writer. - */ -template -concept VariableDictionaryWriterReq = requires( - VariableDictionaryWriterType writer, - std::string_view value, - variable_dictionary_id_t& id_ref -) { - /** - * Adds the given variable to the dictionary if it doesn't exist. - * @param value - * @param id_ref Returns the entry ID of the given variable. - * @return Whether this call resulted in inserting a new entry. - */ - { - writer.add_entry(value, id_ref) - } -> std::same_as; -}; - -/** - * Requirement for the variable dictionary reader interface. - * @tparam VariableDictionaryReaderType The type of the variable dictionary reader. - * @tparam VariableDictionaryEntryType The type of the entries in the variable dictionary reader. - */ -template -concept VariableDictionaryReaderReq = requires( - VariableDictionaryReaderType reader, - variable_dictionary_id_t id, - std::string_view variable, - bool ignore_case, - std::unordered_set& entries -) { - requires VariableDictionaryEntryReq; - - /** - * @param id - * @return The value of the dictionary entry with the given Id. - */ - { - reader.get_value(id) - } -> std::same_as; - - /** - * Gets entries matching a given variable value. - * @param variable The variable value to look up. - * @param ignore_case Whether the search should be case insensitive. - * @return A vector of entries matching the given variable value. - */ - { - reader.get_entry_matching_value(variable, ignore_case) - } -> std::same_as>; - - /** - * Gets entries matching a given wildcard string. - * @param variable A wildcard search string. - * @param ignore_case Whether the search should be case insensitive. - * @param entries Returns all the matching entries. - */ - { - reader.get_entries_matching_wildcard_string(variable, ignore_case, entries) - } -> std::same_as; - - requires std::same_as< - typename VariableDictionaryReaderType::dictionary_id_t, - variable_dictionary_id_t>; -}; -} // namespace clp - -#endif // CLP_DICTIONARYCONCEPTS_HPP diff --git a/components/core/src/clp/EncodedVariableInterpreter.hpp b/components/core/src/clp/EncodedVariableInterpreter.hpp index 29ad8f0747..5e48d6fcc3 100644 --- a/components/core/src/clp/EncodedVariableInterpreter.hpp +++ b/components/core/src/clp/EncodedVariableInterpreter.hpp @@ -8,14 +8,16 @@ #include -#include "DictionaryConcepts.hpp" #include "ffi/ir_stream/decoding_methods.hpp" #include "ir/LogEvent.hpp" #include "ir/types.hpp" +#include "LogTypeDictionaryEntryReq.hpp" #include "Query.hpp" #include "spdlog_with_specializations.hpp" #include "TraceableException.hpp" #include "type_utils.hpp" +#include "VariableDictionaryReaderReq.hpp" +#include "VariableDictionaryWriterReq.hpp" namespace clp { /** diff --git a/components/core/src/clp/GrepCore.hpp b/components/core/src/clp/GrepCore.hpp index 29bef91d8c..4585e13c42 100644 --- a/components/core/src/clp/GrepCore.hpp +++ b/components/core/src/clp/GrepCore.hpp @@ -14,12 +14,13 @@ #include #include "Defs.h" -#include "DictionaryConcepts.hpp" #include "EncodedVariableInterpreter.hpp" #include "ir/parsing.hpp" #include "ir/types.hpp" +#include "LogTypeDictionaryReaderReq.hpp" #include "Query.hpp" #include "QueryToken.hpp" +#include "VariableDictionaryReaderReq.hpp" namespace clp { class GrepCore { diff --git a/components/core/src/clp/LogTypeDictionaryEntryReq.hpp b/components/core/src/clp/LogTypeDictionaryEntryReq.hpp new file mode 100644 index 0000000000..f570c2386a --- /dev/null +++ b/components/core/src/clp/LogTypeDictionaryEntryReq.hpp @@ -0,0 +1,133 @@ +#ifndef CLP_LOGTYPEDICTIONARYENTRYREQ_HPP +#define CLP_LOGTYPEDICTIONARYENTRYREQ_HPP + +#include +#include +#include +#include + +#include "Defs.h" +#include "ir/types.hpp" + +namespace clp { +/** + * Requirement for the logtype dictionary entry interface. + * @tparam LogTypeDictionaryEntryType The type of the logtype dictionary entry. + */ +template +concept LogTypeDictionaryEntryReq = requires( + LogTypeDictionaryEntryType entry, + size_t length, + std::string_view msg, + size_t& begin_pos_ref, + size_t& end_pos_ref, + std::string_view& parsed_var_ref, + size_t begin_pos, + size_t placeholder_idx, + ir::VariablePlaceholder& placeholder_ref +) { + /** + * Clears all internal state. + */ + { + entry.clear() + } -> std::same_as; + + /** + * Reserves space for a logtype string of a given length. + * @param length + */ + { + entry.reserve_constant_length(length) + } -> std::same_as; + + /** + * Parses the next variable from a message according to `ir::get_bounds_of_next_var`, + * constructing the constant part of the message's logtype in the processed range at the same + * time. + * @param msg The original log message. + * @param begin_pos_ref The beginning position of the last variable. Returns the beginning + * position of the next variable. + * @param end_pos_ref The ending position of the last variable (exclusive). Returns the ending + * position of the next variable (exclusive). + * @param parsed_var_ref Returns a view to the parsed variable, if one was found. + * @return Whether a new variable was parsed. + */ + { + entry.parse_next_var(msg, begin_pos_ref, end_pos_ref, parsed_var_ref) + } -> std::same_as; + + /** + * Adds a substring of `msg` to the constant part of the logtype. + * @param msg The value containing a constant to add to the logtype. + * @param begin_pos The starting offset into `msg` to add to the logtype. + * @param length The length of the substring to add to the logtype. + */ + { + entry.add_constant(msg, begin_pos, length) + } -> std::same_as; + + /** + * Adds an integer variable placeholder to the constant part of the logtype. + */ + { + entry.add_int_var() + } -> std::same_as; + + /** + * Adds a float variable placeholder to the constant part of the logtype. + */ + { + entry.add_float_var() + } -> std::same_as; + + /** + * Adds a dictionary variable placeholder to the constant part of the logtype. + */ + { + entry.add_dictionary_var() + } -> std::same_as; + + /** + * @return The constant part of the logtype. + */ + { + entry.get_value() + } -> std::same_as; + + /** + * @return The number of variables in the constant part of the logtype. + */ + { + entry.get_num_variables() + } -> std::same_as; + + /** + * @return The number of variable placeholders (including escaped ones) in the constant part of + * the logtype. + */ + { + entry.get_num_placeholders() + } -> std::same_as; + + /** + * Gets the position and type of a variable placeholder in the logtype. + * @param placeholder_idx The index of the placeholder to get the info for. + * @param placeholder_ref Returns the type of the placeholder at `placeholder_idx`. + * @return The placeholder's position in the logtype, or `SIZE_MAX` if `placeholder_idx` is out + * of bounds. + */ + { + entry.get_placeholder_info(placeholder_idx, placeholder_ref) + } -> std::same_as; + + /** + * @return The dictionary ID for this logtype. + */ + { + entry.get_id() + } -> std::same_as; +}; +} // namespace clp + +#endif // CLP_LOGTYPEDICTIONARYENTRYREQ_HPP diff --git a/components/core/src/clp/LogTypeDictionaryReaderReq.hpp b/components/core/src/clp/LogTypeDictionaryReaderReq.hpp new file mode 100644 index 0000000000..65633d5c72 --- /dev/null +++ b/components/core/src/clp/LogTypeDictionaryReaderReq.hpp @@ -0,0 +1,51 @@ +#ifndef CLP_LOGTYPEDICTIONARYREADERREQ_HPP +#define CLP_LOGTYPEDICTIONARYREADERREQ_HPP + +#include +#include +#include +#include + +#include "Defs.h" +#include "LogTypeDictionaryEntryReq.hpp" + +namespace clp { +/** + * Requirement for the logtype dictionary reader interface. + * @tparam LogTypeDictionaryReaderType The type of the logtype dictionary reader. + */ +template +concept LogTypeDictionaryReaderReq = requires( + LogTypeDictionaryReaderType reader, + std::string_view logtype, + bool ignore_case, + std::unordered_set& entries +) { + requires LogTypeDictionaryEntryReq; + + /** + * Gets entries matching a given logtype. + * @param logtype + * @param ignore_case Whether the search should be case insensitive. + * @return A vector of entries matching the given logtype. + */ + { + reader.get_entry_matching_value(logtype, ignore_case) + } -> std::same_as>; + + /** + * Gets entries matching a wildcard string. + * @param logtype A wildcard search string. + * @param ignore_case Whether the search should be case insensitive. + * @param entries Returns all the matching entries. + */ + { + reader.get_entries_matching_wildcard_string(logtype, ignore_case, entries) + } -> std::same_as; + + requires std:: + same_as; +}; +} // namespace clp + +#endif // CLP_LOGTYPEDICTIONARYREADERREQ_HPP diff --git a/components/core/src/clp/VariableDictionaryEntryReq.hpp b/components/core/src/clp/VariableDictionaryEntryReq.hpp new file mode 100644 index 0000000000..88523e090f --- /dev/null +++ b/components/core/src/clp/VariableDictionaryEntryReq.hpp @@ -0,0 +1,24 @@ +#ifndef CLP_VARIABLEDICTIONARYENTRYREQ_HPP +#define CLP_VARIABLEDICTIONARYENTRYREQ_HPP + +#include + +#include "Defs.h" + +namespace clp { +/** + * Requirement for the variable dictionary entry interface. + * @tparam VariableDictionaryEntryType The type of the variable dictionary entry. + */ +template +concept VariableDictionaryEntryReq = requires(VariableDictionaryEntryType entry) { + /** + * @return The dictionary ID for this variable. + */ + { + entry.get_id() + } -> std::same_as; +}; +} // namespace clp + +#endif // CLP_VARIABLEDICTIONARYENTRYREQ_HPP diff --git a/components/core/src/clp/VariableDictionaryReaderReq.hpp b/components/core/src/clp/VariableDictionaryReaderReq.hpp new file mode 100644 index 0000000000..facf3d3c54 --- /dev/null +++ b/components/core/src/clp/VariableDictionaryReaderReq.hpp @@ -0,0 +1,63 @@ +#ifndef CLP_VARIABLEDICTIONARYREADERREQ_HPP +#define CLP_VARIABLEDICTIONARYREADERREQ_HPP + +#include +#include +#include +#include +#include + +#include "Defs.h" +#include "VariableDictionaryEntryReq.hpp" + +namespace clp { +/** + * Requirement for the variable dictionary reader interface. + * @tparam VariableDictionaryReaderType The type of the variable dictionary reader. + * @tparam VariableDictionaryEntryType The type of the entries in the variable dictionary reader. + */ +template +concept VariableDictionaryReaderReq = requires( + VariableDictionaryReaderType reader, + variable_dictionary_id_t id, + std::string_view variable, + bool ignore_case, + std::unordered_set& entries +) { + requires VariableDictionaryEntryReq; + + /** + * @param id + * @return The value of the dictionary entry with the given Id. + */ + { + reader.get_value(id) + } -> std::same_as; + + /** + * Gets entries matching a given variable value. + * @param variable The variable value to look up. + * @param ignore_case Whether the search should be case insensitive. + * @return A vector of entries matching the given variable value. + */ + { + reader.get_entry_matching_value(variable, ignore_case) + } -> std::same_as>; + + /** + * Gets entries matching a given wildcard string. + * @param variable A wildcard search string. + * @param ignore_case Whether the search should be case insensitive. + * @param entries Returns all the matching entries. + */ + { + reader.get_entries_matching_wildcard_string(variable, ignore_case, entries) + } -> std::same_as; + + requires std::same_as< + typename VariableDictionaryReaderType::dictionary_id_t, + variable_dictionary_id_t>; +}; +} // namespace clp + +#endif // CLP_VARIABLEDICTIONARYREADERREQ_HPP diff --git a/components/core/src/clp/VariableDictionaryWriterReq.hpp b/components/core/src/clp/VariableDictionaryWriterReq.hpp new file mode 100644 index 0000000000..d61aa5956b --- /dev/null +++ b/components/core/src/clp/VariableDictionaryWriterReq.hpp @@ -0,0 +1,31 @@ +#ifndef CLP_VARIABLEDICTIONARYWRITERREQ_HPP +#define CLP_VARIABLEDICTIONARYWRITERREQ_HPP +#include +#include + +#include "Defs.h" + +namespace clp { +/** + * Requirement for the variable dictionary writer interface. + * @tparam VariableDictionaryWriterType The type of the variable dictionary writer. + */ +template +concept VariableDictionaryWriterReq = requires( + VariableDictionaryWriterType writer, + std::string_view value, + variable_dictionary_id_t& id_ref +) { + /** + * Adds the given variable to the dictionary if it doesn't exist. + * @param value + * @param id_ref Returns the entry ID of the given variable. + * @return Whether this call resulted in inserting a new entry. + */ + { + writer.add_entry(value, id_ref) + } -> std::same_as; +}; +} // namespace clp + +#endif // CLP_VARIABLEDICTIONARYWRITERREQ_HPP diff --git a/components/core/src/clp/clg/CMakeLists.txt b/components/core/src/clp/clg/CMakeLists.txt index a93f03b9c2..55c6b058b7 100644 --- a/components/core/src/clp/clg/CMakeLists.txt +++ b/components/core/src/clp/clg/CMakeLists.txt @@ -7,7 +7,6 @@ set( ../Defs.h ../dictionary_utils.cpp ../dictionary_utils.hpp - ../DictionaryConcepts.hpp ../DictionaryEntry.hpp ../DictionaryReader.hpp ../EncodedVariableInterpreter.cpp @@ -49,7 +48,9 @@ set( ../LogSurgeonReader.hpp ../LogTypeDictionaryEntry.cpp ../LogTypeDictionaryEntry.hpp + ../LogTypeDictionaryEntryReq.hpp ../LogTypeDictionaryReader.hpp + ../LogTypeDictionaryReaderReq.hpp ../MySQLDB.cpp ../MySQLDB.hpp ../MySQLParamBindings.cpp @@ -118,9 +119,12 @@ set( ../Utils.hpp ../VariableDictionaryEntry.cpp ../VariableDictionaryEntry.hpp + ../VariableDictionaryEntryReq.hpp ../VariableDictionaryReader.hpp + ../VariableDictionaryReaderReq.hpp ../VariableDictionaryWriter.cpp ../VariableDictionaryWriter.hpp + ../VariableDictionaryWriterReq.hpp ../version.hpp ../WriterInterface.cpp ../WriterInterface.hpp diff --git a/components/core/src/clp/clo/CMakeLists.txt b/components/core/src/clp/clo/CMakeLists.txt index 0e5006594c..28c8da4279 100644 --- a/components/core/src/clp/clo/CMakeLists.txt +++ b/components/core/src/clp/clo/CMakeLists.txt @@ -11,7 +11,6 @@ set( ../Defs.h ../dictionary_utils.cpp ../dictionary_utils.hpp - ../DictionaryConcepts.hpp ../DictionaryEntry.hpp ../DictionaryReader.hpp ../EncodedVariableInterpreter.cpp @@ -50,7 +49,9 @@ set( ../LogSurgeonReader.hpp ../LogTypeDictionaryEntry.cpp ../LogTypeDictionaryEntry.hpp + ../LogTypeDictionaryEntryReq.hpp ../LogTypeDictionaryReader.hpp + ../LogTypeDictionaryReaderReq.hpp ../networking/socket_utils.cpp ../networking/socket_utils.hpp ../networking/SocketOperationFailed.hpp @@ -118,9 +119,12 @@ set( ../Utils.hpp ../VariableDictionaryEntry.cpp ../VariableDictionaryEntry.hpp + ../VariableDictionaryEntryReq.hpp ../VariableDictionaryReader.hpp + ../VariableDictionaryReaderReq.hpp ../VariableDictionaryWriter.cpp ../VariableDictionaryWriter.hpp + ../VariableDictionaryWriterReq.hpp ../version.hpp ../WriterInterface.cpp ../WriterInterface.hpp diff --git a/components/core/src/clp/clp/CMakeLists.txt b/components/core/src/clp/clp/CMakeLists.txt index 778d322db6..699196c169 100644 --- a/components/core/src/clp/clp/CMakeLists.txt +++ b/components/core/src/clp/clp/CMakeLists.txt @@ -10,7 +10,6 @@ set( ../Defs.h ../dictionary_utils.cpp ../dictionary_utils.hpp - ../DictionaryConcepts.hpp ../DictionaryEntry.hpp ../DictionaryReader.hpp ../DictionaryWriter.hpp @@ -65,6 +64,7 @@ set( ../LogSurgeonReader.hpp ../LogTypeDictionaryEntry.cpp ../LogTypeDictionaryEntry.hpp + ../LogTypeDictionaryEntryReq.hpp ../LogTypeDictionaryReader.hpp ../LogTypeDictionaryWriter.cpp ../LogTypeDictionaryWriter.hpp @@ -144,9 +144,12 @@ set( ../Utils.hpp ../VariableDictionaryEntry.cpp ../VariableDictionaryEntry.hpp + ../VariableDictionaryEntryReq.hpp ../VariableDictionaryReader.hpp + ../VariableDictionaryReaderReq.hpp ../VariableDictionaryWriter.cpp ../VariableDictionaryWriter.hpp + ../VariableDictionaryWriterReq.hpp ../version.hpp ../WriterInterface.cpp ../WriterInterface.hpp diff --git a/components/core/src/clp_s/CMakeLists.txt b/components/core/src/clp_s/CMakeLists.txt index b250e483e3..db8c11d741 100644 --- a/components/core/src/clp_s/CMakeLists.txt +++ b/components/core/src/clp_s/CMakeLists.txt @@ -17,7 +17,6 @@ set( ../clp/cli_utils.cpp ../clp/cli_utils.hpp ../clp/Defs.h - ../clp/DictionaryConcepts.hpp ../clp/EncodedVariableInterpreter.cpp ../clp/EncodedVariableInterpreter.hpp ../clp/ErrorCode.hpp @@ -71,6 +70,8 @@ set( ../clp/ir/types.hpp ../clp/LogSurgeonReader.cpp ../clp/LogSurgeonReader.hpp + ../clp/LogTypeDictionaryEntryReq.hpp + ../clp/LogTypeDictionaryReaderReq.hpp ../clp/NetworkReader.cpp ../clp/NetworkReader.hpp ../clp/networking/socket_utils.cpp @@ -98,6 +99,9 @@ set( ../clp/type_utils.hpp ../clp/utf8_utils.cpp ../clp/utf8_utils.hpp + ../clp/VariableDictionaryEntryReq.hpp + ../clp/VariableDictionaryReaderReq.hpp + ../clp/VariableDictionaryWriterReq.hpp ../clp/WriterInterface.cpp ../clp/WriterInterface.hpp ) diff --git a/components/core/src/clp_s/indexer/CMakeLists.txt b/components/core/src/clp_s/indexer/CMakeLists.txt index 1f5077d8a0..b784819a5b 100644 --- a/components/core/src/clp_s/indexer/CMakeLists.txt +++ b/components/core/src/clp_s/indexer/CMakeLists.txt @@ -14,7 +14,6 @@ set( ../../clp/database_utils.cpp ../../clp/database_utils.hpp ../../clp/Defs.h - ../../clp/DictionaryConcepts.hpp ../../clp/EncodedVariableInterpreter.cpp ../../clp/EncodedVariableInterpreter.hpp ../../clp/ErrorCode.hpp @@ -44,6 +43,7 @@ set( ../../clp/ir/parsing.hpp ../../clp/ir/parsing.inc ../../clp/ir/types.hpp + ../../clp/LogTypeDictionaryEntryReq.hpp ../../clp/MySQLDB.cpp ../../clp/MySQLDB.hpp ../../clp/MySQLParamBindings.cpp @@ -61,6 +61,9 @@ set( ../../clp/time_types.hpp ../../clp/TraceableException.hpp ../../clp/type_utils.hpp + ../../clp/VariableDictionaryEntryReq.hpp + ../../clp/VariableDictionaryReaderReq.hpp + ../../clp/VariableDictionaryWriterReq.hpp ../archive_constants.hpp ../ArchiveReader.cpp ../ArchiveReader.hpp From 3201f956755abab728b00e9b5684d57273fafaee Mon Sep 17 00:00:00 2001 From: gibber9809 Date: Wed, 17 Sep 2025 17:32:13 +0000 Subject: [PATCH 14/14] Address rabbit comment --- components/core/src/clp/VariableDictionaryReaderReq.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/components/core/src/clp/VariableDictionaryReaderReq.hpp b/components/core/src/clp/VariableDictionaryReaderReq.hpp index facf3d3c54..9200fbc411 100644 --- a/components/core/src/clp/VariableDictionaryReaderReq.hpp +++ b/components/core/src/clp/VariableDictionaryReaderReq.hpp @@ -14,7 +14,6 @@ namespace clp { /** * Requirement for the variable dictionary reader interface. * @tparam VariableDictionaryReaderType The type of the variable dictionary reader. - * @tparam VariableDictionaryEntryType The type of the entries in the variable dictionary reader. */ template concept VariableDictionaryReaderReq = requires(