| 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 "CDatatypeValueSpaceData.h" |
| 22 |
|
| 23 |
|
| 24 |
namespace Konclude { |
| 25 |
|
| 26 |
namespace Reasoner { |
| 27 |
|
| 28 |
namespace Kernel { |
| 29 |
|
| 30 |
namespace Process { |
| 31 |
|
| 32 |
|
| 33 |
CDatatypeValueSpaceData::CDatatypeValueSpaceData(CProcessContext* processContext) : mClashDepTrackPointCollection(processContext) { |
| 34 |
mProcessContext = processContext; |
| 35 |
} |
| 36 |
|
| 37 |
|
| 38 |
CDatatypeValueSpaceData* CDatatypeValueSpaceData::initValueSpaceData(CDatatypeValueSpaceData* spaceData) { |
| 39 |
if (spaceData) { |
| 40 |
mValueSpaceClashed = spaceData->mValueSpaceClashed; |
| 41 |
mValueSpaceTriggeringCompleted = spaceData->mValueSpaceTriggeringCompleted; |
| 42 |
mValueSpaceTriggeringRequired = spaceData->mValueSpaceTriggeringRequired; |
| 43 |
mValueSpaceInitialisationDepTrackPoint = spaceData->mValueSpaceInitialisationDepTrackPoint; |
| 44 |
mValueSpaceTriggeringStarted = spaceData->mValueSpaceTriggeringStarted; |
| 45 |
mValueSpaceCounted = spaceData->mValueSpaceCounted; |
| 46 |
mValueSpaceClashCheckingRequired = spaceData->mValueSpaceClashCheckingRequired; |
| 47 |
mValuesCounter.initValueCounter(&spaceData->mValuesCounter); |
| 48 |
mClashDepTrackPointCollection.initDependencyTrackPointCollection(&spaceData->mClashDepTrackPointCollection); |
| 49 |
} else { |
| 50 |
mValueSpaceClashed = false; |
| 51 |
mValueSpaceTriggeringCompleted = false; |
| 52 |
mValueSpaceTriggeringRequired = false; |
| 53 |
mValueSpaceTriggeringStarted = false; |
| 54 |
mValueSpaceCounted = false; |
| 55 |
mValueSpaceClashCheckingRequired = false; |
| 56 |
mValueSpaceInitialisationDepTrackPoint = nullptr; |
| 57 |
mValuesCounter.initValueCounter(); |
| 58 |
mClashDepTrackPointCollection.initDependencyTrackPointCollection(nullptr); |
| 59 |
} |
| 60 |
return this; |
| 61 |
} |
| 62 |
|
| 63 |
|
| 64 |
CDatatypeDependencyTrackPointCollection* CDatatypeValueSpaceData::getClashDependencyTrackPointCollection() { |
| 65 |
return &mClashDepTrackPointCollection; |
| 66 |
} |
| 67 |
|
| 68 |
CClashedDependencyDescriptor* CDatatypeValueSpaceData::getClashDependencyDescriptorLinker() { |
| 69 |
return mClashDepTrackPointCollection.getClashedDependencyDescriptors(); |
| 70 |
} |
| 71 |
|
| 72 |
|
| 73 |
bool CDatatypeValueSpaceData::isValueSpaceClashed() { |
| 74 |
return mValueSpaceClashed; |
| 75 |
} |
| 76 |
|
| 77 |
CDatatypeValueSpaceData* CDatatypeValueSpaceData::setValueSpaceClashed(bool clashed) { |
| 78 |
mValueSpaceClashed = clashed; |
| 79 |
return this; |
| 80 |
} |
| 81 |
|
| 82 |
|
| 83 |
bool CDatatypeValueSpaceData::isValueSpaceTriggeringCompleted() { |
| 84 |
return mValueSpaceTriggeringCompleted; |
| 85 |
} |
| 86 |
|
| 87 |
bool CDatatypeValueSpaceData::isValueSpaceTriggeringRequired() { |
| 88 |
return mValueSpaceTriggeringRequired; |
| 89 |
} |
| 90 |
|
| 91 |
CDatatypeValueSpaceData* CDatatypeValueSpaceData::setValueSpaceTriggeringCompleted(bool triggeringCompleted) { |
| 92 |
mValueSpaceTriggeringCompleted = triggeringCompleted; |
| 93 |
return this; |
| 94 |
} |
| 95 |
|
| 96 |
CDatatypeValueSpaceData* CDatatypeValueSpaceData::setValueSpaceTriggeringRequired(bool triggeringRequired) { |
| 97 |
mValueSpaceTriggeringRequired = triggeringRequired; |
| 98 |
return this; |
| 99 |
} |
| 100 |
|
| 101 |
|
| 102 |
bool CDatatypeValueSpaceData::isValueSpaceTriggeringStarted() { |
| 103 |
return mValueSpaceTriggeringStarted; |
| 104 |
} |
| 105 |
|
| 106 |
CDatatypeValueSpaceData* CDatatypeValueSpaceData::setValueSpaceTriggeringStarted(bool triggeringStarted) { |
| 107 |
mValueSpaceTriggeringStarted = triggeringStarted; |
| 108 |
return this; |
| 109 |
} |
| 110 |
|
| 111 |
|
| 112 |
bool CDatatypeValueSpaceData::isValueSpaceCountingRequired() { |
| 113 |
return mValueSpaceCountingRequired; |
| 114 |
} |
| 115 |
|
| 116 |
|
| 117 |
CDatatypeValueSpaceData* CDatatypeValueSpaceData::setValueSpaceCountingRequired(bool triggeringStarted) { |
| 118 |
mValueSpaceCountingRequired = triggeringStarted; |
| 119 |
return this; |
| 120 |
} |
| 121 |
|
| 122 |
|
| 123 |
bool CDatatypeValueSpaceData::isValueSpaceClashCheckingRequired() { |
| 124 |
return mValueSpaceClashCheckingRequired; |
| 125 |
} |
| 126 |
|
| 127 |
|
| 128 |
CDatatypeValueSpaceData* CDatatypeValueSpaceData::setValueSpaceClashCheckingRequired(bool clashCheckingRequired) { |
| 129 |
mValueSpaceClashCheckingRequired = clashCheckingRequired; |
| 130 |
return this; |
| 131 |
} |
| 132 |
|
| 133 |
|
| 134 |
bool CDatatypeValueSpaceData::isValueSpaceCounted() { |
| 135 |
return mValueSpaceCounted; |
| 136 |
} |
| 137 |
|
| 138 |
CDatatypeValueSpaceData* CDatatypeValueSpaceData::setValueSpaceCounted(bool counted) { |
| 139 |
mValueSpaceCounted = counted; |
| 140 |
return this; |
| 141 |
} |
| 142 |
|
| 143 |
|
| 144 |
CDependencyTrackPoint* CDatatypeValueSpaceData::getValueSpaceInitialisationDependencyTrackPoint() { |
| 145 |
return mValueSpaceInitialisationDepTrackPoint; |
| 146 |
} |
| 147 |
|
| 148 |
|
| 149 |
CDatatypeValueSpaceData* CDatatypeValueSpaceData::setValueSpaceInitialisationDependencyTrackPoint(CDependencyTrackPoint* depTrackPoint) { |
| 150 |
mValueSpaceInitialisationDepTrackPoint = depTrackPoint; |
| 151 |
return this; |
| 152 |
} |
| 153 |
|
| 154 |
|
| 155 |
bool CDatatypeValueSpaceData::setValueSpaceInitialisationDependencyTrackPointCandidate(CDependencyTrackPoint* depTrackPoint) { |
| 156 |
if (!mValueSpaceInitialisationDepTrackPoint) { |
| 157 |
mValueSpaceInitialisationDepTrackPoint = depTrackPoint; |
| 158 |
return true; |
| 159 |
} |
| 160 |
return false; |
| 161 |
} |
| 162 |
|
| 163 |
|
| 164 |
CDatatypeValueSpaceData* CDatatypeValueSpaceData::setValueSpaceModification() { |
| 165 |
if (mValueSpaceTriggeringStarted && !mValueSpaceTriggeringCompleted) { |
| 166 |
mValueSpaceTriggeringRequired = true; |
| 167 |
} |
| 168 |
mValueSpaceCounted = false; |
| 169 |
mValueSpaceCountingRequired = true; |
| 170 |
if (!mValueSpaceClashed) { |
| 171 |
mValueSpaceClashCheckingRequired = true; |
| 172 |
} |
| 173 |
return this; |
| 174 |
} |
| 175 |
|
| 176 |
CDatatypeValueSpaceValuesCounter* CDatatypeValueSpaceData::getValuesCounter() { |
| 177 |
return &mValuesCounter; |
| 178 |
} |
| 179 |
|
| 180 |
|
| 181 |
}; // end namespace Process |
| 182 |
|
| 183 |
}; // end namespace Kernel |
| 184 |
|
| 185 |
}; // end namespace Reasoner |
| 186 |
|
| 187 |
}; // end namespace Konclude |