| 1 |
/* |
| 2 |
* Copyright (C) 2013-2015, 2019 by the Konclude Developer Team. |
| 3 |
* |
| 4 |
* This file is part of the reasoning system Konclude. |
| 5 |
* For details and support, see <http://konclude.com/>. |
| 6 |
* |
| 7 |
* Konclude is free software: you can redistribute it and/or modify |
| 8 |
* it under the terms of version 3 of the GNU Lesser General Public |
| 9 |
* License (LGPLv3) as published by the Free Software Foundation. |
| 10 |
* |
| 11 |
* Konclude is distributed in the hope that it will be useful, |
| 12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 |
* GNU (Lesser) General Public License for more details. |
| 15 |
* |
| 16 |
* You should have received a copy of the GNU (Lesser) General Public |
| 17 |
* License along with Konclude. If not, see <http://www.gnu.org/licenses/>. |
| 18 |
* |
| 19 |
*/ |
| 20 |
|
| 21 |
#include "CPrecomputatorStatistics.h" |
| 22 |
|
| 23 |
|
| 24 |
namespace Konclude { |
| 25 |
|
| 26 |
namespace Reasoner { |
| 27 |
|
| 28 |
namespace Consistiser { |
| 29 |
|
| 30 |
|
| 31 |
CPrecomputatorStatistics::CPrecomputatorStatistics(CPrecomputatorStatistics *nextPrecompuationStatistics) { |
| 32 |
resetValues(); |
| 33 |
nextCompStat = nextPrecompuationStatistics; |
| 34 |
} |
| 35 |
|
| 36 |
|
| 37 |
qint64 CPrecomputatorStatistics::getTotalSaturationTaskCount() { |
| 38 |
return mTotalSaturationTasks; |
| 39 |
} |
| 40 |
|
| 41 |
CPrecomputatorStatistics *CPrecomputatorStatistics::incTotalSaturationTaskCount(qint64 incCount) { |
| 42 |
mTotalSaturationTasks += incCount; |
| 43 |
if (nextCompStat) { |
| 44 |
nextCompStat->incTotalSaturationTaskCount(incCount); |
| 45 |
} |
| 46 |
return this; |
| 47 |
} |
| 48 |
|
| 49 |
qint64 CPrecomputatorStatistics::getIndividualSaturationTaskCount() { |
| 50 |
return mIndividualSaturationTasks; |
| 51 |
} |
| 52 |
|
| 53 |
CPrecomputatorStatistics *CPrecomputatorStatistics::incIndividualSaturationTaskCount(qint64 incCount) { |
| 54 |
mIndividualSaturationTasks += incCount; |
| 55 |
if (nextCompStat) { |
| 56 |
nextCompStat->incIndividualSaturationTaskCount(incCount); |
| 57 |
} |
| 58 |
return this; |
| 59 |
} |
| 60 |
|
| 61 |
qint64 CPrecomputatorStatistics::getIndividualPrecomputationTaskCount() { |
| 62 |
return mIndividualPrecomputationTasks; |
| 63 |
} |
| 64 |
|
| 65 |
CPrecomputatorStatistics *CPrecomputatorStatistics::incIndividualPrecomputationTaskCount(qint64 incCount) { |
| 66 |
mIndividualPrecomputationTasks += incCount; |
| 67 |
if (nextCompStat) { |
| 68 |
nextCompStat->incIndividualPrecomputationTaskCount(incCount); |
| 69 |
} |
| 70 |
return this; |
| 71 |
} |
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
CPrecomputatorStatistics *CPrecomputatorStatistics::resetValues() { |
| 76 |
mTotalSaturationTasks = 0; |
| 77 |
mIndividualSaturationTasks = 0; |
| 78 |
mIndividualPrecomputationTasks = 0; |
| 79 |
return this; |
| 80 |
} |
| 81 |
|
| 82 |
|
| 83 |
CPrecomputatorStatistics *CPrecomputatorStatistics::appendStatistics(CPrecomputatorStatistics *statistics) { |
| 84 |
mTotalSaturationTasks += statistics->getTotalSaturationTaskCount(); |
| 85 |
mIndividualSaturationTasks += statistics->getIndividualSaturationTaskCount(); |
| 86 |
mIndividualPrecomputationTasks += statistics->getIndividualPrecomputationTaskCount(); |
| 87 |
return this; |
| 88 |
} |
| 89 |
|
| 90 |
|
| 91 |
}; // end namespace Consistiser |
| 92 |
|
| 93 |
}; // end namespace Reasoner |
| 94 |
|
| 95 |
}; // end namespace Konclude |