| 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 "CComplexQueryProcessingData.h" |
| 22 |
|
| 23 |
|
| 24 |
namespace Konclude { |
| 25 |
|
| 26 |
namespace Reasoner { |
| 27 |
|
| 28 |
namespace Answerer { |
| 29 |
|
| 30 |
|
| 31 |
CComplexQueryProcessingData::CComplexQueryProcessingData(CComplexAnsweringQuery* query, CCallbackData* callback) { |
| 32 |
mComplexAnsweringQuery = query; |
| 33 |
mCallback = callback; |
| 34 |
mUnsatisfiable = false; |
| 35 |
mQueryProcessingInitializedAnsweringStatistics = nullptr; |
| 36 |
} |
| 37 |
|
| 38 |
|
| 39 |
CComplexQueryProcessingData::~CComplexQueryProcessingData() { |
| 40 |
if (mQueryProcessingInitializedAnsweringStatistics) { |
| 41 |
delete mQueryProcessingInitializedAnsweringStatistics; |
| 42 |
} |
| 43 |
} |
| 44 |
|
| 45 |
CComplexAnsweringQuery* CComplexQueryProcessingData::getComplexAnsweringQuery() { |
| 46 |
return mComplexAnsweringQuery; |
| 47 |
} |
| 48 |
|
| 49 |
CCallbackData* CComplexQueryProcessingData::getCallback() { |
| 50 |
return mCallback; |
| 51 |
} |
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
bool CComplexQueryProcessingData::isUnsatisfiable() { |
| 56 |
return mUnsatisfiable; |
| 57 |
} |
| 58 |
|
| 59 |
CComplexQueryProcessingData* CComplexQueryProcessingData::setUnsatisfiable(bool unsat) { |
| 60 |
mUnsatisfiable = unsat; |
| 61 |
return this; |
| 62 |
} |
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
bool CComplexQueryProcessingData::isProcessingStarted() { |
| 68 |
return mProcessingStarted; |
| 69 |
} |
| 70 |
|
| 71 |
CComplexQueryProcessingData* CComplexQueryProcessingData::setProcessingStarted(bool started) { |
| 72 |
mProcessingStarted = started; |
| 73 |
mProcessingTimer.start(); |
| 74 |
return this; |
| 75 |
} |
| 76 |
|
| 77 |
|
| 78 |
bool CComplexQueryProcessingData::isProcessingFinished() { |
| 79 |
return mProcessingFinished; |
| 80 |
} |
| 81 |
|
| 82 |
CComplexQueryProcessingData* CComplexQueryProcessingData::setProcessingFinished(bool finished) { |
| 83 |
mProcessingFinished = finished; |
| 84 |
mProcessingTime = mProcessingTimer.elapsed(); |
| 85 |
return this; |
| 86 |
} |
| 87 |
|
| 88 |
|
| 89 |
CComplexQueryProcessingData* CComplexQueryProcessingData::setSubQueryProcessingFinished(bool finished) { |
| 90 |
mSubQueryProcessingTime = mProcessingTimer.elapsed(); |
| 91 |
mSubQueryProcessingFinished = true; |
| 92 |
return this; |
| 93 |
} |
| 94 |
|
| 95 |
bool CComplexQueryProcessingData::isSubQueryProcessingFinished() { |
| 96 |
return mSubQueryProcessingFinished; |
| 97 |
} |
| 98 |
|
| 99 |
|
| 100 |
qint64 CComplexQueryProcessingData::getTotalProcessingTime() { |
| 101 |
return mProcessingTime; |
| 102 |
} |
| 103 |
|
| 104 |
|
| 105 |
qint64 CComplexQueryProcessingData::getSubQueryProcessingTime() { |
| 106 |
return mSubQueryProcessingTime; |
| 107 |
} |
| 108 |
|
| 109 |
|
| 110 |
CAnsweringHandlingStatistics* CComplexQueryProcessingData::getQueryProcessingInitializedAnsweringStatistics() { |
| 111 |
return mQueryProcessingInitializedAnsweringStatistics; |
| 112 |
} |
| 113 |
|
| 114 |
CComplexQueryProcessingData* CComplexQueryProcessingData::setQueryProcessingInitializedAnsweringStatistics(CAnsweringHandlingStatistics* stats) { |
| 115 |
if (mQueryProcessingInitializedAnsweringStatistics) { |
| 116 |
delete mQueryProcessingInitializedAnsweringStatistics; |
| 117 |
} |
| 118 |
mQueryProcessingInitializedAnsweringStatistics = stats; |
| 119 |
return this; |
| 120 |
} |
| 121 |
|
| 122 |
}; // end namespace Answerer |
| 123 |
|
| 124 |
}; // end namespace Reasoner |
| 125 |
|
| 126 |
}; // end namespace Konclude |