db/update/Service: add SimpleDatabase reference

Don't use the global variables from the DatabaseSimple library.
This commit is contained in:
Max Kellermann
2014-02-04 08:37:05 +01:00
parent f25ef8d682
commit d76b6f878e
6 changed files with 24 additions and 41 deletions

View File

@@ -26,6 +26,8 @@
#include "event/DeferredMonitor.hxx"
#include "thread/Thread.hxx"
class SimpleDatabase;
/**
* This class manages the update queue and runs the update thread.
*/
@@ -36,6 +38,8 @@ class UpdateService final : DeferredMonitor {
UPDATE_PROGRESS_DONE = 2
};
SimpleDatabase &db;
Progress progress;
bool modified;
@@ -53,7 +57,7 @@ class UpdateService final : DeferredMonitor {
UpdateWalk walk;
public:
UpdateService(EventLoop &_loop);
UpdateService(EventLoop &_loop, SimpleDatabase &_db);
/**
* Returns a non-zero job id when we are currently updating