| 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 "COntologyRealizingDynamicRequirmentProcessingData.h" |
| 22 |
|
| 23 |
|
| 24 |
namespace Konclude { |
| 25 |
|
| 26 |
namespace Reasoner { |
| 27 |
|
| 28 |
namespace Realizer { |
| 29 |
|
| 30 |
|
| 31 |
COntologyRealizingDynamicRequirmentProcessingData::COntologyRealizingDynamicRequirmentProcessingData(COntologyProcessingRequirement* procReq, COntologyRealizingDynamicRequirmentCallbackData* callback) { |
| 32 |
for (cint64 i = 0; i < CRealizingTestingStep::TESTINGSTEPTYPECOUNT; ++i) { |
| 33 |
mAssRealStepProcessingCount[i] = 0; |
| 34 |
mAssRealStep[i] = nullptr; |
| 35 |
} |
| 36 |
mCallbackData = callback; |
| 37 |
mProcessingItemCount = 0; |
| 38 |
mProcReq = procReq; |
| 39 |
mStatistics = nullptr; |
| 40 |
if (callback) { |
| 41 |
mStatistics = callback->getStatistics(); |
| 42 |
} |
| 43 |
} |
| 44 |
|
| 45 |
COntologyRealizingDynamicRequirmentProcessingData::~COntologyRealizingDynamicRequirmentProcessingData() { |
| 46 |
} |
| 47 |
|
| 48 |
COntologyRealizingDynamicRequirmentProcessingData* COntologyRealizingDynamicRequirmentProcessingData::incProcessingItemCount(CRealizingTestingStep* realizingStep, cint64 incCount) { |
| 49 |
mProcessingItemCount += incCount; |
| 50 |
mProcessingItemInitialCount += incCount; |
| 51 |
if (realizingStep) { |
| 52 |
mAssRealStepProcessingCount[(cint64)realizingStep->getRealizingTestingType()] += incCount; |
| 53 |
} |
| 54 |
return this; |
| 55 |
} |
| 56 |
|
| 57 |
|
| 58 |
COntologyRealizingDynamicRequirmentProcessingData* COntologyRealizingDynamicRequirmentProcessingData::decProcessingItemCount(CRealizingTestingStep* realizingStep, cint64 decCount) { |
| 59 |
mProcessingItemCount -= decCount; |
| 60 |
if (realizingStep) { |
| 61 |
mAssRealStepProcessingCount[(cint64)realizingStep->getRealizingTestingType()] -= decCount; |
| 62 |
} |
| 63 |
return this; |
| 64 |
} |
| 65 |
|
| 66 |
COntologyRealizingDynamicRequirmentProcessingData* COntologyRealizingDynamicRequirmentProcessingData::setCallbackData(COntologyRealizingDynamicRequirmentCallbackData* callback) { |
| 67 |
mCallbackData = callback; |
| 68 |
return this; |
| 69 |
} |
| 70 |
|
| 71 |
cint64 COntologyRealizingDynamicRequirmentProcessingData::getCurrentProcessingItemCount() { |
| 72 |
return mProcessingItemCount; |
| 73 |
} |
| 74 |
|
| 75 |
bool COntologyRealizingDynamicRequirmentProcessingData::hasCurrentProcessingItemCount() { |
| 76 |
return mProcessingItemCount > 0; |
| 77 |
} |
| 78 |
|
| 79 |
bool COntologyRealizingDynamicRequirmentProcessingData::hasAssociatedRelizationTestingStepProcessingItemCount(CRealizingTestingStep* realizingStep) { |
| 80 |
if (mAssRealStepProcessingCount[(cint64)realizingStep->getRealizingTestingType()] > 0) { |
| 81 |
return true; |
| 82 |
} |
| 83 |
return false; |
| 84 |
} |
| 85 |
|
| 86 |
COntologyRealizingDynamicRequirmentProcessingData* COntologyRealizingDynamicRequirmentProcessingData::clearAssociatedRelizationTestingStep(CRealizingTestingStep::TESTINGSTEPTYPE type) { |
| 87 |
mAssRealStep[(cint64)type] = nullptr; |
| 88 |
return this; |
| 89 |
} |
| 90 |
|
| 91 |
|
| 92 |
CRealizingTestingStep* COntologyRealizingDynamicRequirmentProcessingData::getAssociatedRelizationTestingStep(CRealizingTestingStep::TESTINGSTEPTYPE type) { |
| 93 |
CRealizingTestingStep* step = mAssRealStep[(cint64)type]; |
| 94 |
return step; |
| 95 |
} |
| 96 |
|
| 97 |
COntologyRealizingDynamicRequirmentProcessingData* COntologyRealizingDynamicRequirmentProcessingData::setAssociatedRelizationTestingStep(CRealizingTestingStep* step) { |
| 98 |
mAssRealStep[(cint64)step->getRealizingTestingType()] = step; |
| 99 |
return this; |
| 100 |
} |
| 101 |
|
| 102 |
COntologyRealizingDynamicRequirmentCallbackData* COntologyRealizingDynamicRequirmentProcessingData::getCallbackData() { |
| 103 |
return mCallbackData; |
| 104 |
} |
| 105 |
|
| 106 |
COntologyProcessingRequirement* COntologyRealizingDynamicRequirmentProcessingData::getProcessingRequirement() { |
| 107 |
return mProcReq; |
| 108 |
} |
| 109 |
|
| 110 |
COntologyRealizingDynamicRequirmentProcessingData* COntologyRealizingDynamicRequirmentProcessingData::setProcessingRequirement(COntologyProcessingRequirement* procReq) { |
| 111 |
mProcReq = procReq; |
| 112 |
return this; |
| 113 |
} |
| 114 |
|
| 115 |
COntologyRealizingDynamicRequirmentProcessingStatistics* COntologyRealizingDynamicRequirmentProcessingData::getStatistics() { |
| 116 |
return mStatistics; |
| 117 |
} |
| 118 |
|
| 119 |
|
| 120 |
}; // end namespace Realizer |
| 121 |
|
| 122 |
}; // end namespace Reasoner |
| 123 |
|
| 124 |
}; // end namespace Konclude |