| 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 "CBackendRepresentativeMemoryCacheIndividualAssociationContext.h" |
| 22 |
|
| 23 |
|
| 24 |
namespace Konclude { |
| 25 |
|
| 26 |
namespace Reasoner { |
| 27 |
|
| 28 |
namespace Kernel { |
| 29 |
|
| 30 |
namespace Cache { |
| 31 |
|
| 32 |
|
| 33 |
CBackendRepresentativeMemoryCacheIndividualAssociationContext::CBackendRepresentativeMemoryCacheIndividualAssociationContext(CBackendRepresentativeMemoryCacheContext* cacheContext) |
| 34 |
: mCacheContext(cacheContext), |
| 35 |
mMemoryPoolProvider(cacheContext->getMemoryPoolProvider()), |
| 36 |
mMemMan(&mMemPoolContainer, cacheContext->getMemoryPoolProvider()) { |
| 37 |
|
| 38 |
mFirstRecomputationReferenceLinker = nullptr; |
| 39 |
mLastRecomputationReferenceLinker = nullptr; |
| 40 |
|
| 41 |
mIndividualAssociationDataUsageCount = 0; |
| 42 |
mPreviousMemoryManagementCount = 0; |
| 43 |
setData(this); |
| 44 |
} |
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
CMemoryAllocationManager* CBackendRepresentativeMemoryCacheIndividualAssociationContext::getMemoryAllocationManager() { |
| 50 |
return &mMemMan; |
| 51 |
} |
| 52 |
|
| 53 |
CMemoryPoolProvider* CBackendRepresentativeMemoryCacheIndividualAssociationContext::getMemoryPoolProvider() { |
| 54 |
return mMemoryPoolProvider; |
| 55 |
} |
| 56 |
|
| 57 |
CMemoryPoolContainer* CBackendRepresentativeMemoryCacheIndividualAssociationContext::getMemoryPoolContainer() { |
| 58 |
return &mMemPoolContainer; |
| 59 |
} |
| 60 |
|
| 61 |
CBackendRepresentativeMemoryCacheOntologyDataRecomputationReferenceLinker* CBackendRepresentativeMemoryCacheIndividualAssociationContext::getLastRecomputationReferenceLinker() { |
| 62 |
return mLastRecomputationReferenceLinker; |
| 63 |
} |
| 64 |
|
| 65 |
CBackendRepresentativeMemoryCacheOntologyDataRecomputationReferenceLinker* CBackendRepresentativeMemoryCacheIndividualAssociationContext::getFirstRecomputationReferenceLinker() { |
| 66 |
return mFirstRecomputationReferenceLinker; |
| 67 |
} |
| 68 |
|
| 69 |
CBackendRepresentativeMemoryCacheIndividualAssociationContext* CBackendRepresentativeMemoryCacheIndividualAssociationContext::setLastRecomputationReferenceLinker(CBackendRepresentativeMemoryCacheOntologyDataRecomputationReferenceLinker* recomputationReferenceLinker) { |
| 70 |
mLastRecomputationReferenceLinker = recomputationReferenceLinker; |
| 71 |
return this; |
| 72 |
} |
| 73 |
|
| 74 |
CBackendRepresentativeMemoryCacheIndividualAssociationContext* CBackendRepresentativeMemoryCacheIndividualAssociationContext::setFirstRecomputationReferenceLinker(CBackendRepresentativeMemoryCacheOntologyDataRecomputationReferenceLinker* recomputationReferenceLinker) { |
| 75 |
mFirstRecomputationReferenceLinker = recomputationReferenceLinker; |
| 76 |
return this; |
| 77 |
} |
| 78 |
|
| 79 |
|
| 80 |
cint64 CBackendRepresentativeMemoryCacheIndividualAssociationContext::getIndividualAssociationDataUsageCount() { |
| 81 |
return mIndividualAssociationDataUsageCount; |
| 82 |
} |
| 83 |
|
| 84 |
CBackendRepresentativeMemoryCacheIndividualAssociationContext* CBackendRepresentativeMemoryCacheIndividualAssociationContext::incIndividualAssociationDataUsageCount(cint64 count) { |
| 85 |
mIndividualAssociationDataUsageCount += count; |
| 86 |
return this; |
| 87 |
} |
| 88 |
|
| 89 |
cint64 CBackendRepresentativeMemoryCacheIndividualAssociationContext::getPreviousMemoryManagementCount() { |
| 90 |
return mPreviousMemoryManagementCount; |
| 91 |
} |
| 92 |
|
| 93 |
CBackendRepresentativeMemoryCacheIndividualAssociationContext* CBackendRepresentativeMemoryCacheIndividualAssociationContext::setPreviousMemoryManagementCount(cint64 previousCount) { |
| 94 |
mPreviousMemoryManagementCount = previousCount; |
| 95 |
return this; |
| 96 |
} |
| 97 |
|
| 98 |
|
| 99 |
}; // end namespace Cache |
| 100 |
|
| 101 |
}; // end namespace Kernel |
| 102 |
|
| 103 |
}; // end namespace Reasoner |
| 104 |
|
| 105 |
}; // end namespace Konclude |