LogViewer
A modern log viewer with AI-assisted analysis (Qt 6)
Loading...
Searching...
No Matches
filters::FilterManager Class Reference

Owns all user-defined filters, handles persistence, and provides helpers to apply filters against the events container. More...

#include <FilterManager.hpp>

Collaboration diagram for filters::FilterManager:
Collaboration graph

Public Member Functions

FilterPtr createFilter (const std::string &name, const std::string &columnName, const std::string &pattern, bool caseSensitive=false, bool inverted=false)
 Create a new filter instance with the provided parameters.
 
void addFilter (const FilterPtr &filter)
 Add a filter to the managed list. Duplicate names are rejected.
 
void updateFilter (const FilterPtr &filter)
 Replace an existing filter (matched by name) or append it.
 
void removeFilter (const std::string &filterName)
 Remove a filter identified by name.
 
void enableFilter (const std::string &filterName, bool enable)
 Enable/disable a single filter.
 
void enableAllFilters (bool enable)
 Toggle all known filters at once.
 
std::vector< unsigned long > applyFilters (const mvc::IModel &model) const
 Apply all enabled filters and return the matching indices.
 
std::vector< unsigned long > applyFiltersToIndices (const std::vector< unsigned long > &indices, const mvc::IModel &model) const
 Apply all enabled filters to a subset of indices (AND logic). Filters are applied only to events in the provided indices vector.
 
FilterResult loadFilters ()
 Load filters from the default filters.json path.
 
FilterResult saveFilters () const
 Persist filters to the default filters.json path.
 
const FilterList & getFilters () const
 
std::optional< FilterPtr > getFilterByName (const std::string &name) const
 
std::string getFiltersFilePath () const
 
FilterResult saveFiltersToPath (const std::string &path) const
 
FilterResult loadFiltersFromPath (const std::string &path)
 

Static Public Member Functions

static FilterManager & getInstance ()
 

Private Member Functions

 FilterManager ()
 
 ~FilterManager ()=default
 

Private Attributes

FilterList m_filters
 

Detailed Description

Owns all user-defined filters, handles persistence, and provides helpers to apply filters against the events container.

Constructor & Destructor Documentation

◆ FilterManager()

filters::FilterManager::FilterManager ( )
private
Here is the call graph for this function:

◆ ~FilterManager()

filters::FilterManager::~FilterManager ( )
privatedefault

Member Function Documentation

◆ addFilter()

void filters::FilterManager::addFilter ( const FilterPtr &  filter)

Add a filter to the managed list. Duplicate names are rejected.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ applyFilters()

std::vector< unsigned long > filters::FilterManager::applyFilters ( const mvc::IModel &  model) const

Apply all enabled filters and return the matching indices.

Here is the call graph for this function:

◆ applyFiltersToIndices()

std::vector< unsigned long > filters::FilterManager::applyFiltersToIndices ( const std::vector< unsigned long > &  indices,
const mvc::IModel &  model 
) const

Apply all enabled filters to a subset of indices (AND logic). Filters are applied only to events in the provided indices vector.

Parameters
indicesSubset of event indices to filter
modelThe events model
Returns
Indices that match both the input filter and all enabled filters
Here is the caller graph for this function:

◆ createFilter()

FilterPtr filters::FilterManager::createFilter ( const std::string &  name,
const std::string &  columnName,
const std::string &  pattern,
bool  caseSensitive = false,
bool  inverted = false 
)

Create a new filter instance with the provided parameters.

◆ enableAllFilters()

void filters::FilterManager::enableAllFilters ( bool  enable)

Toggle all known filters at once.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ enableFilter()

void filters::FilterManager::enableFilter ( const std::string &  filterName,
bool  enable 
)

Enable/disable a single filter.

Here is the call graph for this function:

◆ getFilterByName()

std::optional< FilterPtr > filters::FilterManager::getFilterByName ( const std::string &  name) const
Here is the caller graph for this function:

◆ getFilters()

const FilterList & filters::FilterManager::getFilters ( ) const
Here is the caller graph for this function:

◆ getFiltersFilePath()

std::string filters::FilterManager::getFiltersFilePath ( ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getInstance()

FilterManager & filters::FilterManager::getInstance ( )
static
Here is the caller graph for this function:

◆ loadFilters()

FilterResult filters::FilterManager::loadFilters ( )

Load filters from the default filters.json path.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadFiltersFromPath()

FilterResult filters::FilterManager::loadFiltersFromPath ( const std::string &  path)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeFilter()

void filters::FilterManager::removeFilter ( const std::string &  filterName)

Remove a filter identified by name.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ saveFilters()

FilterResult filters::FilterManager::saveFilters ( ) const

Persist filters to the default filters.json path.

Here is the call graph for this function:

◆ saveFiltersToPath()

FilterResult filters::FilterManager::saveFiltersToPath ( const std::string &  path) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateFilter()

void filters::FilterManager::updateFilter ( const FilterPtr &  filter)

Replace an existing filter (matched by name) or append it.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_filters

FilterList filters::FilterManager::m_filters
private

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