LogViewer
A modern log viewer with AI-assisted analysis (Qt 6)
Loading...
Searching...
No Matches
parser::IDataParserObserver Class Referenceabstract

Observer interface for receiving notifications from data parsers. More...

#include <IDataParser.hpp>

Inheritance diagram for parser::IDataParserObserver:
Inheritance graph
Collaboration diagram for parser::IDataParserObserver:
Collaboration graph

Public Member Functions

virtual ~IDataParserObserver ()=default
 Virtual destructor for proper cleanup of derived classes.
 
virtual void ProgressUpdated ()=0
 Called when parsing progress is updated.
 
virtual void NewEventFound (db::LogEvent &&event)=0
 Called when a new event is discovered during parsing.
 
virtual void NewEventBatchFound (std::vector< std::pair< int, db::LogEvent::EventItems > > &&eventBatch)=0
 Called when a batch of new events is discovered during parsing.
 

Detailed Description

Observer interface for receiving notifications from data parsers.

This interface follows the Observer pattern to provide loose coupling between data parsing operations and user interface components. Observers receive notifications about parsing progress and newly discovered events.

Usage Example
class MyObserver : public IDataParserObserver {
public:
void ProgressUpdated() override {
// Update progress bar in UI
}
void NewEventFound(db::LogEvent&& event) override {
// Add event to display container
events.AddEvent(std::move(event));
}
};
Represents a single, structured log event with key-value data.
Definition LogEvent.hpp:97
Observer interface for receiving notifications from data parsers.
Definition IDataParser.hpp:52

Constructor & Destructor Documentation

◆ ~IDataParserObserver()

virtual parser::IDataParserObserver::~IDataParserObserver ( )
virtualdefault

Virtual destructor for proper cleanup of derived classes.

Member Function Documentation

◆ NewEventBatchFound()

virtual void parser::IDataParserObserver::NewEventBatchFound ( std::vector< std::pair< int, db::LogEvent::EventItems > > &&  eventBatch)
pure virtual

Called when a batch of new events is discovered during parsing.

For performance reasons, parsers may collect multiple events before notifying observers. This method delivers a batch of events at once.

Parameters
eventBatchVector of (id, items) pairs representing the events
Note
This method is preferred over NewEventFound for high-throughput scenarios

Implemented in ui::qt::SideBySidePanel::LoadJob::Observer, ui::qt::FileTailer::TailObserver, mvc::MainController, and ui::MainWindowPresenter.

◆ NewEventFound()

virtual void parser::IDataParserObserver::NewEventFound ( db::LogEvent &&  event)
pure virtual

Called when a new event is discovered during parsing.

Parameters
eventThe newly parsed LogEvent (moved to avoid copying)
Note
Implementations should be efficient as this may be called very frequently during parsing of large files

Implemented in ui::qt::SideBySidePanel::LoadJob::Observer, ui::qt::FileTailer::TailObserver, mvc::MainController, and ui::MainWindowPresenter.

◆ ProgressUpdated()

virtual void parser::IDataParserObserver::ProgressUpdated ( )
pure virtual

Called when parsing progress is updated.

This method is invoked periodically during parsing operations to allow observers to update progress indicators in the user interface.

Note
Implementations should be efficient as this may be called frequently

Implemented in mvc::MainController, ui::MainWindowPresenter, ui::qt::SideBySidePanel::LoadJob::Observer, and ui::qt::FileTailer::TailObserver.


The documentation for this class was generated from the following file: