|
|
|
#ifndef DATAMANAGER_H
|
|
|
|
#define DATAMANAGER_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
#include "data/filter/FilterParser.h"
|
|
|
|
#include "type/AdvancedFilterDto.h"
|
|
|
|
#include "data/filter/IFilter.h"
|
|
|
|
#include "LogWarehouse.h"
|
|
|
|
|
|
|
|
class DataManager : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
DataManager(FilterCreator_ptr<Log_ptr> filterCreator);
|
|
|
|
|
|
|
|
void clearLogs();
|
|
|
|
void setFilter(QString filter);
|
|
|
|
void setAdvancedFilters(AdvancedFilterDto dto);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void badFilterRequested(QString message);
|
|
|
|
void logAdded(const Log_ptr log);
|
|
|
|
void logsReseted(QList<Log_ptr> logs);
|
|
|
|
|
|
|
|
//uncrustify off
|
|
|
|
public slots:
|
|
|
|
//uncrustify on
|
|
|
|
void onLogProvided(Log_ptr log);
|
|
|
|
|
|
|
|
private:
|
|
|
|
void resetView();
|
|
|
|
void setFilter(std::shared_ptr<IFilter<Log_ptr> > filter);
|
|
|
|
bool isLogAccepted(const Log_ptr& log);
|
|
|
|
|
|
|
|
LogWarehouse_ptr _warehouse;
|
|
|
|
std::shared_ptr<IFilter<Log_ptr> > _filter;
|
|
|
|
std::shared_ptr<IFilter<Log_ptr> > _advancedFilter;
|
|
|
|
FilterParser<Log_ptr> _filterParser;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif //DATAMANAGER_H
|