| 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 "CBackendRepresentativeMemoryCacheOntologyData.h" |
| 22 |
|
| 23 |
|
| 24 |
namespace Konclude { |
| 25 |
|
| 26 |
namespace Reasoner { |
| 27 |
|
| 28 |
namespace Kernel { |
| 29 |
|
| 30 |
namespace Cache { |
| 31 |
|
| 32 |
|
| 33 |
CBackendRepresentativeMemoryCacheOntologyData::CBackendRepresentativeMemoryCacheOntologyData(CBackendRepresentativeMemoryCacheBaseContext* baseContext) : mTemporaryContext(baseContext) { |
| 34 |
} |
| 35 |
|
| 36 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::initOntologyData(cint64 ontologyIdentifer, bool directIndexing) { |
| 37 |
mOntologyIdentifer = ontologyIdentifer; |
| 38 |
|
| 39 |
for (cint64 i = 0; i < CBackendRepresentativeMemoryLabelCacheItem::LABEL_CACHE_ITEM_TYPE_COUNT; ++i) { |
| 40 |
mSigLabelItemHash[i] = nullptr; |
| 41 |
} |
| 42 |
mNominalIndiIdIndirectConnectionDataHash = nullptr; |
| 43 |
mIndiIdAssoDataHash = nullptr; |
| 44 |
mIndiIdAssoDataVector = nullptr; |
| 45 |
mIndiIdAssoDataVectorSize = 0; |
| 46 |
mSameMergedIndisInCache = false; |
| 47 |
mAssociationCompleted = false; |
| 48 |
mFirstIncompletelyHandledIndividualsRetrieved = false; |
| 49 |
mLastMinIncompletelyHandledIndiId = CINT64_MAX; |
| 50 |
mMaxIndiAssocDataUpdateCount = 0; |
| 51 |
mIncompletelyHandledIndiIdCount = 0; |
| 52 |
mIndividualAssociationsCount = 0; |
| 53 |
mUsageCount = 0; |
| 54 |
mOntologyContext = nullptr; |
| 55 |
mNextEntryID = 1; |
| 56 |
mProblematicIncompletelyHandledIndiSet = nullptr; |
| 57 |
mPrioritizedPropagationMarkedNeighbourLabelItem = nullptr; |
| 58 |
|
| 59 |
mIndividualLabelAssociationIndexed = directIndexing; |
| 60 |
mIndividualLabelAssociationIndexedWaitingCount = 0; |
| 61 |
mIndividualLabelAssociationIndexingCount = 0; |
| 62 |
mMaxStoredIndvidualiId = 0; |
| 63 |
mNextSlotUpdateWaitingCount = 0; |
| 64 |
mSlotUpdateIntegrated = false; |
| 65 |
mBasicPrecomputationMode = false; |
| 66 |
mBasicPrecompuationIndiIdAssoDataVector = nullptr; |
| 67 |
mBasicPrecompuationIndiIdAssoDataVectorSize = 0; |
| 68 |
mBasicPrecompuationRetrievalIndiIdPos = 0; |
| 69 |
mBasicPrecomputationModeActivation = false; |
| 70 |
mIndividualAssociationDataUpdateCount = 0; |
| 71 |
mIndividualAssociationDataDirectUpdateCount = 0; |
| 72 |
mIndividualAssociationMergingCount = 0; |
| 73 |
mInvolvedIndividualCount = 0; |
| 74 |
mIncompletelyHandledIndividualsRetrievalCount = 0; |
| 75 |
mCacheDataUpdateWritingCount = 0; |
| 76 |
mRecomputationReferenceLinker = nullptr; |
| 77 |
mLastActiveRecomputationReferenceLinker = nullptr; |
| 78 |
|
| 79 |
mMinimumValidRecomputationId = 0; |
| 80 |
mNextUpdateMinimumValidRecomputationId = 0; |
| 81 |
mOntologyDataUpdateId = 1; |
| 82 |
mReleaseQueuedIndividualAssociationContextLinker = nullptr; |
| 83 |
mRecomputationIdReleasingIndividualAssociationMap = nullptr; |
| 84 |
return this; |
| 85 |
} |
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::copyOntologyData(CBackendRepresentativeMemoryCacheOntologyData* data) { |
| 90 |
mSameMergedIndisInCache = data->mSameMergedIndisInCache; |
| 91 |
mMaxIndiAssocDataUpdateCount = data->mMaxIndiAssocDataUpdateCount; |
| 92 |
mAssociationCompleted = data->mAssociationCompleted; |
| 93 |
mIncompletelyHandledIndiIdCount = data->mIncompletelyHandledIndiIdCount; |
| 94 |
mLastMinIncompletelyHandledIndiId = data->mLastMinIncompletelyHandledIndiId; |
| 95 |
mNextEntryID = data->mNextEntryID; |
| 96 |
mMaxStoredIndvidualiId = data->mMaxStoredIndvidualiId; |
| 97 |
mIndividualLabelAssociationIndexed = data->mIndividualLabelAssociationIndexed; |
| 98 |
mIndividualAssociationsCount = data->mIndividualAssociationsCount; |
| 99 |
mFirstIncompletelyHandledIndividualsRetrieved = data->mFirstIncompletelyHandledIndividualsRetrieved; |
| 100 |
mNextSlotUpdateWaitingCount = data->mNextSlotUpdateWaitingCount; |
| 101 |
|
| 102 |
mBasicPrecomputationMode = data->mBasicPrecomputationMode; |
| 103 |
mBasicPrecompuationIndiIdAssoDataVector = data->mBasicPrecompuationIndiIdAssoDataVector; |
| 104 |
mBasicPrecompuationIndiIdAssoDataVectorSize = data->mBasicPrecompuationIndiIdAssoDataVectorSize; |
| 105 |
mBasicPrecompuationRetrievalIndiIdPos = data->mBasicPrecompuationRetrievalIndiIdPos; |
| 106 |
mBasicPrecomputationModeActivation = data->mBasicPrecomputationModeActivation; |
| 107 |
|
| 108 |
mIndividualAssociationDataDirectUpdateCount = data->mIndividualAssociationDataDirectUpdateCount; |
| 109 |
mIndividualAssociationDataUpdateCount = data->mIndividualAssociationDataUpdateCount; |
| 110 |
mIndividualAssociationMergingCount = data->mIndividualAssociationMergingCount; |
| 111 |
mInvolvedIndividualCount = data->mInvolvedIndividualCount; |
| 112 |
|
| 113 |
mIncompletelyHandledIndividualsRetrievalCount = data->mIncompletelyHandledIndividualsRetrievalCount; |
| 114 |
mCacheDataUpdateWritingCount = data->mCacheDataUpdateWritingCount; |
| 115 |
mRecomputationReferenceLinker = data->mRecomputationReferenceLinker; |
| 116 |
mLastActiveRecomputationReferenceLinker = nullptr; |
| 117 |
|
| 118 |
mMinimumValidRecomputationId = data->mMinimumValidRecomputationId; |
| 119 |
mNextUpdateMinimumValidRecomputationId = data->mNextUpdateMinimumValidRecomputationId; |
| 120 |
mOntologyDataUpdateId = data->mOntologyDataUpdateId + 1; |
| 121 |
mReleaseQueuedIndividualAssociationContextLinker = data->mReleaseQueuedIndividualAssociationContextLinker; |
| 122 |
mRecomputationIdReleasingIndividualAssociationMap = data->mRecomputationIdReleasingIndividualAssociationMap; |
| 123 |
mPrioritizedPropagationMarkedNeighbourLabelItem = data->mPrioritizedPropagationMarkedNeighbourLabelItem; |
| 124 |
return this; |
| 125 |
} |
| 126 |
|
| 127 |
|
| 128 |
bool CBackendRepresentativeMemoryCacheOntologyData::isIndividualLabelAssociationIndexed() { |
| 129 |
return mIndividualLabelAssociationIndexed; |
| 130 |
} |
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::setIndividualLabelAssociationIndexingCount(cint64 count) { |
| 135 |
mIndividualLabelAssociationIndexingCount = count; |
| 136 |
return this; |
| 137 |
} |
| 138 |
|
| 139 |
|
| 140 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::setIndividualLabelAssociationIndexed(bool indexed) { |
| 141 |
mIndividualLabelAssociationIndexed = indexed; |
| 142 |
return this; |
| 143 |
} |
| 144 |
|
| 145 |
|
| 146 |
cint64 CBackendRepresentativeMemoryCacheOntologyData::updateIndividualLabelAssociationIndexed(bool releaseWaiting, CMemoryPool* memoryPools) { |
| 147 |
cint64 remainingCount = 0; |
| 148 |
mIndividualLabelAssociationIndexedWaitingMutex.lock(); |
| 149 |
mOntologyContext->getMemoryPoolContainer()->appendMemoryPool(memoryPools); |
| 150 |
mIndividualLabelAssociationIndexingCount.deref(); |
| 151 |
remainingCount = mIndividualLabelAssociationIndexingCount; |
| 152 |
if (mIndividualLabelAssociationIndexingCount <= 0) { |
| 153 |
mIndividualLabelAssociationIndexed = true; |
| 154 |
if (releaseWaiting) { |
| 155 |
mIndividualLabelAssociationIndexedWaitingSemaphore.release(mIndividualLabelAssociationIndexedWaitingCount); |
| 156 |
mIndividualLabelAssociationIndexedWaitingCount = 0; |
| 157 |
} |
| 158 |
} |
| 159 |
mIndividualLabelAssociationIndexedWaitingMutex.unlock(); |
| 160 |
return remainingCount; |
| 161 |
} |
| 162 |
|
| 163 |
|
| 164 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::waitIndividualLabelAssociationIndexed() { |
| 165 |
if (!mIndividualLabelAssociationIndexed) { |
| 166 |
mIndividualLabelAssociationIndexedWaitingMutex.lock(); |
| 167 |
if (!mIndividualLabelAssociationIndexed) { |
| 168 |
++mIndividualLabelAssociationIndexedWaitingCount; |
| 169 |
mIndividualLabelAssociationIndexedWaitingMutex.unlock(); |
| 170 |
mIndividualLabelAssociationIndexedWaitingSemaphore.acquire(); |
| 171 |
} else { |
| 172 |
mIndividualLabelAssociationIndexedWaitingMutex.unlock(); |
| 173 |
} |
| 174 |
|
| 175 |
} |
| 176 |
return this; |
| 177 |
} |
| 178 |
|
| 179 |
|
| 180 |
cint64 CBackendRepresentativeMemoryCacheOntologyData::getOntologyIdentifer() { |
| 181 |
return mOntologyIdentifer; |
| 182 |
} |
| 183 |
|
| 184 |
cint64 CBackendRepresentativeMemoryCacheOntologyData::getUsageCount() { |
| 185 |
return mUsageCount; |
| 186 |
} |
| 187 |
|
| 188 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::incUsageCount(cint64 count) { |
| 189 |
mUsageCount += count; |
| 190 |
return this; |
| 191 |
} |
| 192 |
|
| 193 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::decUsageCount(cint64 count) { |
| 194 |
mUsageCount -= count; |
| 195 |
return this; |
| 196 |
} |
| 197 |
|
| 198 |
|
| 199 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::setSignatureLabelItemHash(cint64 labelType, CCACHINGHASH<cint64, CBackendRepresentativeMemoryLabelSignatureResolveCacheItem>* sigItemHash) { |
| 200 |
mSigLabelItemHash[labelType] = sigItemHash; |
| 201 |
return this; |
| 202 |
} |
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
bool CBackendRepresentativeMemoryCacheOntologyData::hasSameIndividualsMergings() { |
| 207 |
return mSameMergedIndisInCache; |
| 208 |
} |
| 209 |
|
| 210 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::setSameIndividualsMergings(bool sameIndisMergings) { |
| 211 |
mSameMergedIndisInCache = sameIndisMergings; |
| 212 |
return this; |
| 213 |
} |
| 214 |
|
| 215 |
|
| 216 |
CCACHINGHASH<cint64, CBackendRepresentativeMemoryLabelSignatureResolveCacheItem>* CBackendRepresentativeMemoryCacheOntologyData::getSignatureLabelItemHash(cint64 labelType) { |
| 217 |
return mSigLabelItemHash[labelType]; |
| 218 |
} |
| 219 |
|
| 220 |
|
| 221 |
CCACHINGHASH<cint64, CBackendRepresentativeMemoryCacheIndividualAssociationData*>* CBackendRepresentativeMemoryCacheOntologyData::getIndividualIdAssociationDataHash() { |
| 222 |
return mIndiIdAssoDataHash; |
| 223 |
} |
| 224 |
|
| 225 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::setIndividualIdAssociationDataHash(CCACHINGHASH<cint64, CBackendRepresentativeMemoryCacheIndividualAssociationData*>* indiIdAssoDataHash) { |
| 226 |
mIndiIdAssoDataHash = indiIdAssoDataHash; |
| 227 |
return this; |
| 228 |
} |
| 229 |
|
| 230 |
|
| 231 |
cint64 CBackendRepresentativeMemoryCacheOntologyData::getIndividualIdAssoiationDataVectorSize() { |
| 232 |
return mIndiIdAssoDataVectorSize; |
| 233 |
} |
| 234 |
|
| 235 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::setIndividualIdAssoiationDataVectorSize(cint64 size) { |
| 236 |
mIndiIdAssoDataVectorSize = size; |
| 237 |
return this; |
| 238 |
} |
| 239 |
|
| 240 |
|
| 241 |
CBackendRepresentativeMemoryCacheIndividualAssociationData** CBackendRepresentativeMemoryCacheOntologyData::getIndividualIdAssoiationDataVector() { |
| 242 |
return mIndiIdAssoDataVector; |
| 243 |
} |
| 244 |
|
| 245 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::setIndividualIdAssoiationDataVector(cint64 indiIdAssoDataVectorSize, CBackendRepresentativeMemoryCacheIndividualAssociationData** indiIdAssoDataVector) { |
| 246 |
mIndiIdAssoDataVector = indiIdAssoDataVector; |
| 247 |
mIndiIdAssoDataVectorSize = indiIdAssoDataVectorSize; |
| 248 |
return this; |
| 249 |
} |
| 250 |
|
| 251 |
|
| 252 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::setNominaIIndividualdIndirectConnectionDataHash(CCACHINGHASH<cint64, CBackendRepresentativeMemoryCacheNominalIndividualIndirectConnectionData* >* hash) { |
| 253 |
mNominalIndiIdIndirectConnectionDataHash = hash; |
| 254 |
return this; |
| 255 |
} |
| 256 |
|
| 257 |
|
| 258 |
CCACHINGHASH<cint64, CBackendRepresentativeMemoryCacheNominalIndividualIndirectConnectionData* >* CBackendRepresentativeMemoryCacheOntologyData::getNominaIIndividualdIndirectConnectionDataHash() { |
| 259 |
return mNominalIndiIdIndirectConnectionDataHash; |
| 260 |
} |
| 261 |
|
| 262 |
|
| 263 |
|
| 264 |
|
| 265 |
cint64 CBackendRepresentativeMemoryCacheOntologyData::getMaxStoredIndvidualiId() { |
| 266 |
return mMaxStoredIndvidualiId; |
| 267 |
} |
| 268 |
|
| 269 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::updateMaxStoredIndvidualiId(cint64 id) { |
| 270 |
mMaxStoredIndvidualiId = qMax(id, mMaxStoredIndvidualiId); |
| 271 |
return this; |
| 272 |
} |
| 273 |
|
| 274 |
|
| 275 |
|
| 276 |
|
| 277 |
cint64 CBackendRepresentativeMemoryCacheOntologyData::getNextEntryID(bool moveNext) { |
| 278 |
cint64 nextEntryId = mNextEntryID; |
| 279 |
if (moveNext) { |
| 280 |
mNextEntryID++; |
| 281 |
} |
| 282 |
return nextEntryId; |
| 283 |
} |
| 284 |
|
| 285 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::setNextEntryID(cint64 nextEntryID) { |
| 286 |
mNextEntryID = nextEntryID; |
| 287 |
return this; |
| 288 |
} |
| 289 |
|
| 290 |
|
| 291 |
|
| 292 |
cint64 CBackendRepresentativeMemoryCacheOntologyData::getLastMinIncompletelyHandledIndvidualiId() { |
| 293 |
return mLastMinIncompletelyHandledIndiId; |
| 294 |
} |
| 295 |
|
| 296 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::setLastMinIncompletelyHandledIndvidualiId(cint64 id) { |
| 297 |
mLastMinIncompletelyHandledIndiId = id; |
| 298 |
return this; |
| 299 |
} |
| 300 |
|
| 301 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::incLastMinIncompletelyHandledIndvidualiId(cint64 count) { |
| 302 |
mLastMinIncompletelyHandledIndiId += count; |
| 303 |
return this; |
| 304 |
} |
| 305 |
|
| 306 |
cint64 CBackendRepresentativeMemoryCacheOntologyData::getIndividualAssociationsCount() { |
| 307 |
return mIndividualAssociationsCount; |
| 308 |
} |
| 309 |
|
| 310 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::setIndividualAssociationsCount(cint64 count) { |
| 311 |
mIndividualAssociationsCount = count; |
| 312 |
return this; |
| 313 |
} |
| 314 |
|
| 315 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::incIndividualAssociationsCount(cint64 count) { |
| 316 |
mIndividualAssociationsCount += count; |
| 317 |
return this; |
| 318 |
} |
| 319 |
|
| 320 |
cint64 CBackendRepresentativeMemoryCacheOntologyData::getIncompletelyHandledIndividualIdCount() { |
| 321 |
return mIncompletelyHandledIndiIdCount; |
| 322 |
} |
| 323 |
|
| 324 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::setIncompletelyHandledIndividualIdCount(cint64 count) { |
| 325 |
mIncompletelyHandledIndiIdCount = count; |
| 326 |
return this; |
| 327 |
} |
| 328 |
|
| 329 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::incIncompletelyHandledIndividualIdCount(cint64 count) { |
| 330 |
mIncompletelyHandledIndiIdCount += count; |
| 331 |
return this; |
| 332 |
} |
| 333 |
|
| 334 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::decIncompletelyHandledIndividualIdCount(cint64 count) { |
| 335 |
mIncompletelyHandledIndiIdCount -= count; |
| 336 |
return this; |
| 337 |
} |
| 338 |
|
| 339 |
|
| 340 |
bool CBackendRepresentativeMemoryCacheOntologyData::isAssociationCompleted() { |
| 341 |
return mAssociationCompleted; |
| 342 |
} |
| 343 |
|
| 344 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::setAssociationCompleted(bool completed) { |
| 345 |
mAssociationCompleted = completed; |
| 346 |
return this; |
| 347 |
} |
| 348 |
|
| 349 |
bool CBackendRepresentativeMemoryCacheOntologyData::isFirstIncompletelyHandledIndividualsRetrieved() { |
| 350 |
return mFirstIncompletelyHandledIndividualsRetrieved; |
| 351 |
} |
| 352 |
|
| 353 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::setFirstIncompletelyHandledIndividualsRetrieved(bool retrieved) { |
| 354 |
mFirstIncompletelyHandledIndividualsRetrieved = retrieved; |
| 355 |
return this; |
| 356 |
} |
| 357 |
|
| 358 |
cint64 CBackendRepresentativeMemoryCacheOntologyData::getMaxIndividualAssociationDataUpdateCount() { |
| 359 |
return mMaxIndiAssocDataUpdateCount; |
| 360 |
} |
| 361 |
|
| 362 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::setMaxIndividualAssociationDataUpdateCount(cint64 count) { |
| 363 |
mMaxIndiAssocDataUpdateCount = count; |
| 364 |
return this; |
| 365 |
} |
| 366 |
|
| 367 |
|
| 368 |
CBackendRepresentativeMemoryCacheOntologyContext* CBackendRepresentativeMemoryCacheOntologyData::getTemporaryContext() { |
| 369 |
return &mTemporaryContext; |
| 370 |
} |
| 371 |
|
| 372 |
CBackendRepresentativeMemoryCacheOntologyContext* CBackendRepresentativeMemoryCacheOntologyData::getOntologyContext() { |
| 373 |
return mOntologyContext; |
| 374 |
} |
| 375 |
|
| 376 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::setOntologyContext(CBackendRepresentativeMemoryCacheOntologyContext* ontContext) { |
| 377 |
mOntologyContext = ontContext; |
| 378 |
return this; |
| 379 |
} |
| 380 |
|
| 381 |
CCACHINGSET<cint64>* CBackendRepresentativeMemoryCacheOntologyData::getProblematicIncompletelyHandledIndividualSet() { |
| 382 |
return mProblematicIncompletelyHandledIndiSet; |
| 383 |
} |
| 384 |
|
| 385 |
|
| 386 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::setProblematicIncompletelyHandledIndividualSet(CCACHINGSET<cint64>* indiSet) { |
| 387 |
mProblematicIncompletelyHandledIndiSet = indiSet; |
| 388 |
return this; |
| 389 |
} |
| 390 |
|
| 391 |
|
| 392 |
CBackendRepresentativeMemoryLabelCacheItem* CBackendRepresentativeMemoryCacheOntologyData::getPrioritizedPropagationMarkedNeighbourLabelItem() { |
| 393 |
return mPrioritizedPropagationMarkedNeighbourLabelItem; |
| 394 |
} |
| 395 |
|
| 396 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::setPrioritizedPropagationMarkedNeighbourLabelItem(CBackendRepresentativeMemoryLabelCacheItem* labelItem) { |
| 397 |
mPrioritizedPropagationMarkedNeighbourLabelItem = labelItem; |
| 398 |
return this; |
| 399 |
} |
| 400 |
|
| 401 |
|
| 402 |
cint64 CBackendRepresentativeMemoryCacheOntologyData::getNextSlotUpdateWaitingCount() { |
| 403 |
return mNextSlotUpdateWaitingCount; |
| 404 |
} |
| 405 |
|
| 406 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::setNextSlotUpdateWaitingCount(cint64 updateCount) { |
| 407 |
mNextSlotUpdateWaitingCount = updateCount; |
| 408 |
return this; |
| 409 |
} |
| 410 |
|
| 411 |
bool CBackendRepresentativeMemoryCacheOntologyData::isSlotUpdateIntegrated() { |
| 412 |
return mSlotUpdateIntegrated; |
| 413 |
} |
| 414 |
|
| 415 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::setSlotUpdateIntegrated(bool integrated) { |
| 416 |
mSlotUpdateIntegrated = integrated; |
| 417 |
return this; |
| 418 |
} |
| 419 |
|
| 420 |
bool CBackendRepresentativeMemoryCacheOntologyData::isBasicPrecomputationMode() { |
| 421 |
return mBasicPrecomputationMode; |
| 422 |
} |
| 423 |
|
| 424 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::setBasicPrecomputationMode(bool basicPrecomputation) { |
| 425 |
mBasicPrecomputationMode = basicPrecomputation; |
| 426 |
return this; |
| 427 |
} |
| 428 |
|
| 429 |
cint64 CBackendRepresentativeMemoryCacheOntologyData::getBasicPrecomputationIndividualIdAssoiationDataVectorSize() { |
| 430 |
return mBasicPrecompuationIndiIdAssoDataVectorSize; |
| 431 |
} |
| 432 |
|
| 433 |
|
| 434 |
CBackendRepresentativeMemoryCacheIndividualAssociationData** CBackendRepresentativeMemoryCacheOntologyData::getBasicPrecomputationIndividualIdAssoiationDataVector() { |
| 435 |
return mBasicPrecompuationIndiIdAssoDataVector; |
| 436 |
} |
| 437 |
|
| 438 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::setBasicPrecomputationIndividualIdAssoiationDataVector(cint64 indiIdAssoDataVectorSize, CBackendRepresentativeMemoryCacheIndividualAssociationData** indiIdAssoDataVector) { |
| 439 |
mBasicPrecompuationIndiIdAssoDataVector = indiIdAssoDataVector; |
| 440 |
mBasicPrecompuationIndiIdAssoDataVectorSize = indiIdAssoDataVectorSize; |
| 441 |
return this; |
| 442 |
} |
| 443 |
|
| 444 |
cint64 CBackendRepresentativeMemoryCacheOntologyData::getBasicPrecompuationRetrievalIndividualIdPosition() { |
| 445 |
return mBasicPrecompuationRetrievalIndiIdPos; |
| 446 |
} |
| 447 |
|
| 448 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::setBasicPrecompuationRetrievalIndividualIdPosition(cint64 indiPos) { |
| 449 |
mBasicPrecompuationRetrievalIndiIdPos = indiPos; |
| 450 |
return this; |
| 451 |
} |
| 452 |
|
| 453 |
bool CBackendRepresentativeMemoryCacheOntologyData::hasBasicPrecomputationModeActivation() { |
| 454 |
return mBasicPrecomputationModeActivation; |
| 455 |
} |
| 456 |
|
| 457 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::setBasicPrecomputationModeActivation(bool basicPrecomputationActivation) { |
| 458 |
mBasicPrecomputationModeActivation = basicPrecomputationActivation; |
| 459 |
return this; |
| 460 |
} |
| 461 |
|
| 462 |
|
| 463 |
cint64 CBackendRepresentativeMemoryCacheOntologyData::getIndividualAssociationDataUpdateCount() { |
| 464 |
return mIndividualAssociationDataUpdateCount; |
| 465 |
} |
| 466 |
|
| 467 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::incIndividualAssociationDataUpdateCount(cint64 count) { |
| 468 |
mIndividualAssociationDataUpdateCount += count; |
| 469 |
return this; |
| 470 |
} |
| 471 |
|
| 472 |
cint64 CBackendRepresentativeMemoryCacheOntologyData::getIndividualAssociationDataDirectUpdateCount() { |
| 473 |
return mIndividualAssociationDataDirectUpdateCount; |
| 474 |
} |
| 475 |
|
| 476 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::incIndividualAssociationDataDirectUpdateCount(cint64 count) { |
| 477 |
mIndividualAssociationDataDirectUpdateCount += count; |
| 478 |
return this; |
| 479 |
} |
| 480 |
|
| 481 |
|
| 482 |
cint64 CBackendRepresentativeMemoryCacheOntologyData::getIndividualAssociationMergingCount() { |
| 483 |
return mIndividualAssociationMergingCount; |
| 484 |
} |
| 485 |
|
| 486 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::incIndividualAssociationMergingCount(cint64 count) { |
| 487 |
mIndividualAssociationMergingCount += count; |
| 488 |
return this; |
| 489 |
} |
| 490 |
|
| 491 |
cint64 CBackendRepresentativeMemoryCacheOntologyData::getInvolvedIndividualCount() { |
| 492 |
return mInvolvedIndividualCount; |
| 493 |
} |
| 494 |
|
| 495 |
bool CBackendRepresentativeMemoryCacheOntologyData::hasInvolvedIndividuals() { |
| 496 |
return mInvolvedIndividualCount > 0; |
| 497 |
} |
| 498 |
|
| 499 |
|
| 500 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::incInvolvedIndividualCount(cint64 count) { |
| 501 |
mInvolvedIndividualCount += count; |
| 502 |
return this; |
| 503 |
} |
| 504 |
|
| 505 |
|
| 506 |
cint64 CBackendRepresentativeMemoryCacheOntologyData::getIncompletelyHandledIndividualsRetrievalCount() { |
| 507 |
return mIncompletelyHandledIndividualsRetrievalCount; |
| 508 |
} |
| 509 |
|
| 510 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::incIncompletelyHandledIndividualsRetrievalCount(cint64 count) { |
| 511 |
mIncompletelyHandledIndividualsRetrievalCount += count; |
| 512 |
return this; |
| 513 |
} |
| 514 |
|
| 515 |
cint64 CBackendRepresentativeMemoryCacheOntologyData::getCacheDataUpdateWritingCount() { |
| 516 |
return mCacheDataUpdateWritingCount; |
| 517 |
} |
| 518 |
|
| 519 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::incCacheDataUpdateWritingCount(cint64 count) { |
| 520 |
mCacheDataUpdateWritingCount += count; |
| 521 |
return this; |
| 522 |
} |
| 523 |
|
| 524 |
|
| 525 |
CBackendRepresentativeMemoryCacheOntologyDataRecomputationReferenceLinker* CBackendRepresentativeMemoryCacheOntologyData::getLastActiveRecomputationReferenceLinker() { |
| 526 |
if (!mLastActiveRecomputationReferenceLinker) { |
| 527 |
CBackendRepresentativeMemoryCacheOntologyDataRecomputationReferenceLinker* linkerIt = mRecomputationReferenceLinker; |
| 528 |
CBackendRepresentativeMemoryCacheOntologyDataRecomputationReferenceLinker* lastLinker = linkerIt; |
| 529 |
while (linkerIt) { |
| 530 |
if (linkerIt->isOntologyDataActive()) { |
| 531 |
mLastActiveRecomputationReferenceLinker = linkerIt; |
| 532 |
} |
| 533 |
if (linkerIt->isNextOntologyDataAllInactive()) { |
| 534 |
break; |
| 535 |
} |
| 536 |
lastLinker = linkerIt; |
| 537 |
linkerIt = linkerIt->getNext(); |
| 538 |
} |
| 539 |
if (!mLastActiveRecomputationReferenceLinker) { |
| 540 |
mLastActiveRecomputationReferenceLinker = lastLinker; |
| 541 |
} |
| 542 |
|
| 543 |
linkerIt = mLastActiveRecomputationReferenceLinker->getNext(); |
| 544 |
while (linkerIt && !linkerIt->isNextOntologyDataAllInactive()) { |
| 545 |
linkerIt->setNextOntologyDataAllInactive(); |
| 546 |
linkerIt = linkerIt->getNext(); |
| 547 |
} |
| 548 |
} |
| 549 |
return mLastActiveRecomputationReferenceLinker; |
| 550 |
} |
| 551 |
|
| 552 |
|
| 553 |
CBackendRepresentativeMemoryCacheOntologyDataRecomputationReferenceLinker* CBackendRepresentativeMemoryCacheOntologyData::getRecomputationReferenceLinker() { |
| 554 |
return mRecomputationReferenceLinker; |
| 555 |
} |
| 556 |
|
| 557 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::setRecomputationReferenceLinker(CBackendRepresentativeMemoryCacheOntologyDataRecomputationReferenceLinker* linker) { |
| 558 |
mRecomputationReferenceLinker = linker->append(mRecomputationReferenceLinker); |
| 559 |
return this; |
| 560 |
} |
| 561 |
|
| 562 |
|
| 563 |
|
| 564 |
cint64 CBackendRepresentativeMemoryCacheOntologyData::getMinimumValidRecomputationId() { |
| 565 |
return mMinimumValidRecomputationId; |
| 566 |
} |
| 567 |
|
| 568 |
cint64 CBackendRepresentativeMemoryCacheOntologyData::getNextUpdateMinimumValidRecomputationId() { |
| 569 |
return mNextUpdateMinimumValidRecomputationId; |
| 570 |
} |
| 571 |
|
| 572 |
|
| 573 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::setMinimumValidRecomputationId(cint64 recomputationId) { |
| 574 |
mMinimumValidRecomputationId = recomputationId; |
| 575 |
return this; |
| 576 |
} |
| 577 |
|
| 578 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::setNextUpdateMinimumValidRecomputationId(cint64 recomputationId) { |
| 579 |
mNextUpdateMinimumValidRecomputationId = recomputationId; |
| 580 |
return this; |
| 581 |
} |
| 582 |
|
| 583 |
cint64 CBackendRepresentativeMemoryCacheOntologyData::getOntologyDataUpdateId() { |
| 584 |
return mOntologyDataUpdateId; |
| 585 |
} |
| 586 |
|
| 587 |
|
| 588 |
CCACHINGMAP<cint64, CBackendRepresentativeMemoryCacheIndividualAssociationContext*>* CBackendRepresentativeMemoryCacheOntologyData::getRecomputationIdReleasingIndividualAssociationContextMap() { |
| 589 |
return mRecomputationIdReleasingIndividualAssociationMap; |
| 590 |
} |
| 591 |
|
| 592 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::setRecomputationIdReleasingIndividualAssociationContextMap(CCACHINGMAP<cint64, CBackendRepresentativeMemoryCacheIndividualAssociationContext*>* map) { |
| 593 |
mRecomputationIdReleasingIndividualAssociationMap = map; |
| 594 |
return this; |
| 595 |
} |
| 596 |
|
| 597 |
CBackendRepresentativeMemoryCacheIndividualAssociationContext* CBackendRepresentativeMemoryCacheOntologyData::getReleaseQueuedIndividualAssociationContextLinker() { |
| 598 |
return mReleaseQueuedIndividualAssociationContextLinker; |
| 599 |
} |
| 600 |
|
| 601 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::setReleaseQueuedIndividualAssociationContextLinker(CBackendRepresentativeMemoryCacheIndividualAssociationContext* linker) { |
| 602 |
mReleaseQueuedIndividualAssociationContextLinker = linker; |
| 603 |
return this; |
| 604 |
} |
| 605 |
|
| 606 |
CBackendRepresentativeMemoryCacheOntologyData* CBackendRepresentativeMemoryCacheOntologyData::addReleaseQueuedIndividualAssociationContextLinker(CBackendRepresentativeMemoryCacheIndividualAssociationContext* linker) { |
| 607 |
mReleaseQueuedIndividualAssociationContextLinker = linker->append(mReleaseQueuedIndividualAssociationContextLinker); |
| 608 |
return this; |
| 609 |
} |
| 610 |
|
| 611 |
|
| 612 |
|
| 613 |
}; // end namespace Cache |
| 614 |
|
| 615 |
}; // end namespace Kernel |
| 616 |
|
| 617 |
}; // end namespace Reasoner |
| 618 |
|
| 619 |
}; // end namespace Konclude |