diff --git a/components/core/CMakeLists.txt b/components/core/CMakeLists.txt index ceec57d5ce..6181cfd24f 100644 --- a/components/core/CMakeLists.txt +++ b/components/core/CMakeLists.txt @@ -580,7 +580,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 @@ -673,9 +675,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/DictionaryReader.hpp b/components/core/src/clp/DictionaryReader.hpp index 7e8f3a3a16..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 entry_t = 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 280a2ae3dd..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 entry_t = 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 aecbd93c41..5e48d6fcc3 100644 --- a/components/core/src/clp/EncodedVariableInterpreter.hpp +++ b/components/core/src/clp/EncodedVariableInterpreter.hpp @@ -11,10 +11,13 @@ #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 { /** @@ -123,7 +126,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, @@ -149,8 +154,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, @@ -172,8 +177,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, @@ -195,7 +200,7 @@ class EncodedVariableInterpreter { * dictionary * @return false otherwise */ - template + template static bool encode_and_search_dictionary( std::string_view var_str, VariableDictionaryReaderType const& var_dict, @@ -207,16 +212,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 < - typename VariableDictionaryReaderType, - typename 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, @@ -237,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, @@ -256,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, @@ -265,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, @@ -289,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, @@ -362,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, @@ -436,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, @@ -485,7 +493,7 @@ bool EncodedVariableInterpreter::encode_and_search_dictionary( return true; } -template +template bool EncodedVariableInterpreter::wildcard_search_dictionary_and_get_encoded_matches( std::string_view var_wildcard_str, VariableDictionaryReaderType const& var_dict, @@ -493,7 +501,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 @@ -513,7 +521,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, @@ -532,7 +542,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/GrepCore.hpp b/components/core/src/clp/GrepCore.hpp index 042d8f14a1..4585e13c42 100644 --- a/components/core/src/clp/GrepCore.hpp +++ b/components/core/src/clp/GrepCore.hpp @@ -17,8 +17,10 @@ #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 { @@ -42,7 +44,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 +111,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, @@ -120,7 +124,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 @@ -132,9 +135,8 @@ class GrepCore { * @return SubQueryMatchabilityResult::MayMatch */ template < - typename LogTypeDictionaryReaderType, - typename VariableDictionaryReaderType, - typename LogTypeDictionaryEntryType = typename LogTypeDictionaryReaderType::entry_t> + LogTypeDictionaryReaderReq LogTypeDictionaryReaderType, + VariableDictionaryReaderReq VariableDictionaryReaderType> static SubQueryMatchabilityResult generate_logtypes_and_vars_for_subquery( LogTypeDictionaryReaderType const& logtype_dict, VariableDictionaryReaderType const& var_dict, @@ -145,7 +147,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 +270,7 @@ std::optional GrepCore::process_raw_query( }; } -template +template bool GrepCore::process_var_token( QueryToken const& query_token, VariableDictionaryReaderType const& var_dict, @@ -328,9 +332,8 @@ bool GrepCore::process_var_token( } template < - typename LogTypeDictionaryReaderType, - typename VariableDictionaryReaderType, - typename LogTypeDictionaryEntryType> + LogTypeDictionaryReaderReq LogTypeDictionaryReaderType, + VariableDictionaryReaderReq VariableDictionaryReaderType> GrepCore::SubQueryMatchabilityResult GrepCore::generate_logtypes_and_vars_for_subquery( LogTypeDictionaryReaderType const& logtype_dict, VariableDictionaryReaderType const& var_dict, @@ -407,7 +410,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/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..9200fbc411 --- /dev/null +++ b/components/core/src/clp/VariableDictionaryReaderReq.hpp @@ -0,0 +1,62 @@ +#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. + */ +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 d96f240b67..55c6b058b7 100644 --- a/components/core/src/clp/clg/CMakeLists.txt +++ b/components/core/src/clp/clg/CMakeLists.txt @@ -48,7 +48,9 @@ set( ../LogSurgeonReader.hpp ../LogTypeDictionaryEntry.cpp ../LogTypeDictionaryEntry.hpp + ../LogTypeDictionaryEntryReq.hpp ../LogTypeDictionaryReader.hpp + ../LogTypeDictionaryReaderReq.hpp ../MySQLDB.cpp ../MySQLDB.hpp ../MySQLParamBindings.cpp @@ -117,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 d53fe21d1f..28c8da4279 100644 --- a/components/core/src/clp/clo/CMakeLists.txt +++ b/components/core/src/clp/clo/CMakeLists.txt @@ -49,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 @@ -117,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 c0bf965a61..699196c169 100644 --- a/components/core/src/clp/clp/CMakeLists.txt +++ b/components/core/src/clp/clp/CMakeLists.txt @@ -64,6 +64,7 @@ set( ../LogSurgeonReader.hpp ../LogTypeDictionaryEntry.cpp ../LogTypeDictionaryEntry.hpp + ../LogTypeDictionaryEntryReq.hpp ../LogTypeDictionaryReader.hpp ../LogTypeDictionaryWriter.cpp ../LogTypeDictionaryWriter.hpp @@ -143,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 840d90c2ee..db8c11d741 100644 --- a/components/core/src/clp_s/CMakeLists.txt +++ b/components/core/src/clp_s/CMakeLists.txt @@ -70,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 @@ -97,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/DictionaryReader.hpp b/components/core/src/clp_s/DictionaryReader.hpp index 05e81ee7bd..0256ab053d 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" @@ -28,7 +29,7 @@ class DictionaryReader { }; using dictionary_id_t = DictionaryIdType; - using entry_t = EntryType; + using Entry = EntryType; // Constructors DictionaryReader(ArchiveReaderAdaptor& adaptor) : m_is_open(false), m_adaptor(adaptor) {} @@ -96,8 +97,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) { diff --git a/components/core/src/clp_s/DictionaryWriter.hpp b/components/core/src/clp_s/DictionaryWriter.hpp index 0920e8bae9..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 entry_t = EntryType; + using Entry = EntryType; // Constructors DictionaryWriter() : m_is_open(false) {} diff --git a/components/core/src/clp_s/indexer/CMakeLists.txt b/components/core/src/clp_s/indexer/CMakeLists.txt index e63b4021fe..b784819a5b 100644 --- a/components/core/src/clp_s/indexer/CMakeLists.txt +++ b/components/core/src/clp_s/indexer/CMakeLists.txt @@ -43,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 @@ -60,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