101 using EventItems = std::vector<std::pair<std::string, std::string>>;
105 std::vector<std::pair<std::string, std::string>>::iterator;
109 std::vector<std::pair<std::string, std::string>>::const_iterator;
136 template <
typename... Args>
158 std::initializer_list<std::pair<std::string, std::string>> items)
214 const std::string
findByKey(std::string_view key)
const;
230 const std::vector<std::string>
findAllByKey(std::string_view key)
const;
281 void SetId(
int newId);
C++20 concept definitions for LogViewer.
Represents a single, structured log event with key-value data.
Definition LogEvent.hpp:97
std::vector< std::pair< std::string, std::string > >::iterator EventItemsIterator
Iterator type for traversing event items.
Definition LogEvent.hpp:105
EventItems m_eventItems
The structured data of the event.
Definition LogEvent.hpp:297
void SetId(int newId)
Updates the event's ID (used during merge to reassign sequential IDs)
Definition LogEvent.cpp:90
EventItemsIterator findInEvent(const std::string &search)
Finds an iterator to the first item matching the search term.
Definition LogEvent.cpp:50
std::string m_source
Source identifier for multi-file merge.
Definition LogEvent.hpp:298
const EventItems & getEventItems() const
Gets a const reference to the event's data items.
Definition LogEvent.cpp:20
LogEvent(int id, Args &&... args)
Template constructor with perfect forwarding.
Definition LogEvent.hpp:138
void SetSource(const std::string &source)
Sets the source identifier for this event.
Definition LogEvent.hpp:293
int getId() const
Gets the unique ID of the event.
Definition LogEvent.cpp:15
const std::vector< std::string > findAllByKey(std::string_view key) const
Finds all values by its key in the event's items.
Definition LogEvent.cpp:38
const std::string & GetSource() const
Gets the source identifier for this event.
Definition LogEvent.hpp:287
bool operator==(const LogEvent &other) const
Equality comparison operator.
Definition LogEvent.hpp:256
int m_id
Unique event identifier.
Definition LogEvent.hpp:296
std::vector< std::pair< std::string, std::string > >::const_iterator EventItemsConstIterator
Const iterator type for traversing event items.
Definition LogEvent.hpp:109
LogEvent(int id, std::initializer_list< std::pair< std::string, std::string > > items)
Constructs a LogEvent from an initializer list.
Definition LogEvent.hpp:157
const std::string findByKey(std::string_view key) const
Finds a value by its key in the event's items.
Definition LogEvent.cpp:25
void SetOriginalId(int originalId)
Sets the original ID before merge (stores as event data)
Definition LogEvent.cpp:72
std::vector< std::pair< std::string, std::string > > EventItems
A collection of key-value pairs representing event data (eventFieldName, data).
Definition LogEvent.hpp:101
Matches types that can be constructed from the given arguments.
Definition Concepts.hpp:45
Database and data model components for the LogViewer application.
Definition EventsContainer.cpp:17