#ifndef CACHE_H
#define CACHE_H
-#include "eniro.h"
+#include <QtCore/QList>
+#include <QtCore/QPair>
+#include "source.h"
class Cache
{
public:
+ struct LogDetails
+ {
+ Source::Result result;
+ int time;
+ bool missed;
+ };
+
+ static int const LOG_MAX_SIZE = 80;
+
static Cache& instance();
int clear();
- bool findItem(QString const& number, Eniro::Result& result);
- bool addItem(Eniro::Result const& result);
+ bool findItem(QString const& number, Source::Result& result);
+ bool addItem(Source::Result const& result);
+ bool logItem(Source::Result const& result, bool missed, unsigned int time);
+ void getLogItems(QList<LogDetails>& items, int limit);
+ int clearLog();
private:
Cache();