From 3c8113e543388f8c29fdc4e5b311d60a8a0a8302 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 4 Feb 2018 18:38:40 +0300 Subject: checker for MDBX, first version --- plugins/Dbx_mdbx/src/dbintf.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'plugins/Dbx_mdbx/src/dbintf.cpp') diff --git a/plugins/Dbx_mdbx/src/dbintf.cpp b/plugins/Dbx_mdbx/src/dbintf.cpp index 679141dc79..93d6a7db09 100644 --- a/plugins/Dbx_mdbx/src/dbintf.cpp +++ b/plugins/Dbx_mdbx/src/dbintf.cpp @@ -201,7 +201,7 @@ int CDbxMDBX::Map() /////////////////////////////////////////////////////////////////////////////// // MIDatabaseChecker -typedef int (CDbxMDBX::*CheckWorker)(int); +typedef int (CDbxMDBX::*CheckWorker)(void); int CDbxMDBX::Start(DBCHeckCallback *callback) { @@ -209,9 +209,18 @@ int CDbxMDBX::Start(DBCHeckCallback *callback) return ERROR_SUCCESS; } -int CDbxMDBX::CheckDb(int, int) +static CheckWorker Workers[6] = { - return ERROR_OUT_OF_PAPER; + &CDbxMDBX::CheckEvents1, + &CDbxMDBX::CheckEvents2, +}; + +int CDbxMDBX::CheckDb(int phase, int) +{ + if (phase >= _countof(Workers)) + return ERROR_OUT_OF_PAPER; + + return (this->*Workers[phase])(); } void CDbxMDBX::Destroy() -- cgit v1.2.3