DatabasePlugin: add method GetUpdateStamp()

Refactor SimpleDatabase::GetLastModified() to be generic for all
plugins.  Remove the SimpleDatabase assumption from db_stats_print(),
allowing it to be implemented by all database plugins.
This commit is contained in:
Max Kellermann
2013-11-22 00:35:29 +01:00
parent 099a2cb586
commit c064e8d62f
6 changed files with 26 additions and 26 deletions
+5
View File
@@ -71,6 +71,11 @@ public:
DatabaseStats &stats,
Error &error) const override;
virtual time_t GetUpdateStamp() const override {
// TODO: implement
return 0;
}
private:
bool Configure(const config_param &param, Error &error);
+4 -7
View File
@@ -26,8 +26,6 @@
#include <cassert>
#include <time.h>
struct Directory;
class SimpleDatabase : public Database {
@@ -55,11 +53,6 @@ public:
bool Save(Error &error);
gcc_pure
time_t GetLastModified() const {
return mtime;
}
static Database *Create(const config_param &param,
Error &error);
@@ -85,6 +78,10 @@ public:
DatabaseStats &stats,
Error &error) const override;
virtual time_t GetUpdateStamp() const override {
return mtime;
}
protected:
bool Configure(const config_param &param, Error &error);