| 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 |
#ifndef KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCACHEINDIVIDUALASSOCIATIONDATA_H |
| 22 |
#define KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCACHEINDIVIDUALASSOCIATIONDATA_H |
| 23 |
|
| 24 |
// Libraries includes |
| 25 |
|
| 26 |
|
| 27 |
// Namespace includes |
| 28 |
#include "CacheSettings.h" |
| 29 |
#include "CBackendRepresentativeMemoryLabelCacheItem.h" |
| 30 |
#include "CBackendRepresentativeMemoryCardinalityCacheItem.h" |
| 31 |
#include "CBackendRepresentativeMemoryCachingFlags.h" |
| 32 |
#include "CBackendRepresentativeMemoryCacheIndividualNeighbourRoleSetHash.h" |
| 33 |
#include "CBackendRepresentativeMemoryCacheIndividualRoleSetNeighbourArray.h" |
| 34 |
#include "CBackendRepresentativeMemoryCacheIndividualAssociationContext.h" |
| 35 |
|
| 36 |
|
| 37 |
// Other includes |
| 38 |
#include "Reasoner/Ontology/CIndividualBackendCachingData.h" |
| 39 |
|
| 40 |
// Logger includes |
| 41 |
#include "Logger/CLogger.h" |
| 42 |
|
| 43 |
|
| 44 |
namespace Konclude { |
| 45 |
|
| 46 |
namespace Reasoner { |
| 47 |
|
| 48 |
using namespace Ontology; |
| 49 |
|
| 50 |
namespace Kernel { |
| 51 |
|
| 52 |
namespace Cache { |
| 53 |
|
| 54 |
/*! |
| 55 |
* |
| 56 |
* \class CBackendRepresentativeMemoryCacheIndividualAssociationData |
| 57 |
* \author Andreas Steigmiller |
| 58 |
* \version 0.1 |
| 59 |
* \brief TODO |
| 60 |
* |
| 61 |
*/ |
| 62 |
class CBackendRepresentativeMemoryCacheIndividualAssociationData : public CIndividualBackendCachingData, public CBackendRepresentativeMemoryCachingFlags { |
| 63 |
// public methods |
| 64 |
public: |
| 65 |
//! Constructor |
| 66 |
CBackendRepresentativeMemoryCacheIndividualAssociationData(); |
| 67 |
|
| 68 |
CBackendRepresentativeMemoryCacheIndividualAssociationData* initAssociationData(CBackendRepresentativeMemoryCacheIndividualAssociationData* assData, bool increaseUpdateId = true); |
| 69 |
CBackendRepresentativeMemoryCacheIndividualAssociationData* initAssociationData(cint64 indiId); |
| 70 |
CBackendRepresentativeMemoryCacheIndividualAssociationData* setIndividualId(cint64 indiId); |
| 71 |
|
| 72 |
CBackendRepresentativeMemoryLabelCacheItem* getDeterministicConceptSetLabelCacheEntry(); |
| 73 |
CBackendRepresentativeMemoryCacheIndividualAssociationData* setDeterministicConceptSetLabelCacheEntry(CBackendRepresentativeMemoryLabelCacheItem* cacheEntry); |
| 74 |
|
| 75 |
CBackendRepresentativeMemoryLabelCacheItem* getLabelCacheEntry(cint64 labelType); |
| 76 |
CBackendRepresentativeMemoryCacheIndividualAssociationData* setLabelCacheEntry(cint64 labelType, CBackendRepresentativeMemoryLabelCacheItem* cacheEntry); |
| 77 |
|
| 78 |
|
| 79 |
CBackendRepresentativeMemoryLabelCacheItem* getDeterministicMergedSameConsideredLabelCacheEntry(); |
| 80 |
CBackendRepresentativeMemoryCacheIndividualAssociationData* setDeterministicMergedSameConsideredLabelCacheEntry(CBackendRepresentativeMemoryLabelCacheItem* cacheEntry); |
| 81 |
|
| 82 |
|
| 83 |
CBackendRepresentativeMemoryCardinalityCacheItem* getBackendCardinalityCacheEntry(); |
| 84 |
CBackendRepresentativeMemoryCacheIndividualAssociationData* setBackendCardinalityCacheEntry(CBackendRepresentativeMemoryCardinalityCacheItem* cacheEntry); |
| 85 |
|
| 86 |
bool isIncompletelyMarked(); |
| 87 |
CBackendRepresentativeMemoryCacheIndividualAssociationData* setIncompletelyMarked(bool marked); |
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
CBackendRepresentativeMemoryCacheIndividualNeighbourRoleSetHash* getNeighbourRoleSetHash(); |
| 92 |
CBackendRepresentativeMemoryCacheIndividualAssociationData* setNeighbourRoleSetHash(CBackendRepresentativeMemoryCacheIndividualNeighbourRoleSetHash* neighbourRoleSetHash); |
| 93 |
CBackendRepresentativeMemoryCacheIndividualRoleSetNeighbourArray* getRoleSetNeighbourArray(); |
| 94 |
CBackendRepresentativeMemoryCacheIndividualAssociationData* setRoleSetNeighbourArray(CBackendRepresentativeMemoryCacheIndividualRoleSetNeighbourArray* roleSetNeighbourArray); |
| 95 |
|
| 96 |
cint64 getAssociationDataUpdateId(); |
| 97 |
cint64 getCacheUpdateId(); |
| 98 |
cint64 getCacheTouchId(); |
| 99 |
CBackendRepresentativeMemoryCacheIndividualAssociationData* setCacheUpdateId(cint64 updateId); |
| 100 |
CBackendRepresentativeMemoryCacheIndividualAssociationData* setCacheTouchId(cint64 updateId); |
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
cint64 getLastIntegratedIndirectlyConnectedIndividualsChangeId(); |
| 105 |
CBackendRepresentativeMemoryCacheIndividualAssociationData* setLastIntegratedIndirectlyConnectedIndividualsChangeId(cint64 lastIntegratedChangeId); |
| 106 |
|
| 107 |
|
| 108 |
bool isIndirectlyConnectedNominalIndividual(); |
| 109 |
CBackendRepresentativeMemoryCacheIndividualAssociationData* setIndirectlyConnectedNominalIndividual(bool indirectlyConnected); |
| 110 |
|
| 111 |
bool hasIndirectlyConnectedIndividualIntegration(); |
| 112 |
CBackendRepresentativeMemoryCacheIndividualAssociationData* setIndirectlyConnectedIndividualIntegration(bool indirectlyConnectedIndividualIntegration); |
| 113 |
|
| 114 |
cint64 getRepresentativeSameIndividualId(); |
| 115 |
CBackendRepresentativeMemoryCacheIndividualAssociationData* setRepresentativeSameIndividualId(cint64 indiId); |
| 116 |
cint64 hasRepresentativeSameIndividualMerging(); |
| 117 |
|
| 118 |
|
| 119 |
cint64 getDeterministicSameIndividualId(); |
| 120 |
CBackendRepresentativeMemoryCacheIndividualAssociationData* setDeterministicSameIndividualId(cint64 indiId); |
| 121 |
cint64 hasDeterministicSameIndividualMerging(); |
| 122 |
|
| 123 |
|
| 124 |
cint64 getAssociatedIndividualId(); |
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
cint64 hasProblematicLevel(); |
| 129 |
cint64 getProblematicLevel(); |
| 130 |
CBackendRepresentativeMemoryCacheIndividualAssociationData* setProblematicLevel(cint64 level); |
| 131 |
CBackendRepresentativeMemoryCacheIndividualAssociationData* incProblematicLevel(cint64 count = 1); |
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
cint64 hasProblematicLeveledNeigbour(); |
| 136 |
CBackendRepresentativeMemoryCacheIndividualAssociationData* setProblematicLeveledNeigbour(bool neighbourPropLeveled); |
| 137 |
|
| 138 |
|
| 139 |
CBackendRepresentativeMemoryCacheIndividualAssociationData* getPreviousData(); |
| 140 |
#ifdef KONCLUDE_CACHE_DEBUGGING_DATA_GENERATION |
| 141 |
cint64 mDebugUpdateRecomputationId = -1; |
| 142 |
bool mDebugNeighbourCompletionRequested = false; |
| 143 |
bool mDebugNeighbourCompletionPerformed = false; |
| 144 |
bool mDebugNeighbourCompletionExtended = false; |
| 145 |
bool mDebugSameIndividualsCompletion = false; |
| 146 |
QString mDebugUpdateFunction; |
| 147 |
CIndividual* mDebugIndi = nullptr; |
| 148 |
#endif |
| 149 |
|
| 150 |
|
| 151 |
CBackendRepresentativeMemoryCacheIndividualAssociationContext* getIndividualAssociationMemoryContext(); |
| 152 |
CBackendRepresentativeMemoryCacheIndividualAssociationData* setIndividualAssociationMemoryContext(CBackendRepresentativeMemoryCacheIndividualAssociationContext* memCon); |
| 153 |
|
| 154 |
|
| 155 |
CBackendRepresentativeMemoryCacheIndividualAssociationData* setLastPropagationCuttingUpdateId(cint64 id); |
| 156 |
cint64 getLastPropagationCuttingUpdateId(); |
| 157 |
bool hasLastPropagationCuttingUpdateId(); |
| 158 |
|
| 159 |
|
| 160 |
CBackendRepresentativeMemoryCacheIndividualRoleSetNeighbourIndividualIdLinker* getPropagationCutRemovedNeighbourIndividualLinker(); |
| 161 |
CBackendRepresentativeMemoryCacheIndividualAssociationData* setPropagationCutRemovedNeighbourIndividualLinker(CBackendRepresentativeMemoryCacheIndividualRoleSetNeighbourIndividualIdLinker* linker); |
| 162 |
|
| 163 |
|
| 164 |
// protected methods |
| 165 |
protected: |
| 166 |
|
| 167 |
// protected variables |
| 168 |
protected: |
| 169 |
CBackendRepresentativeMemoryLabelCacheItem* mLabelCacheEntries[CBackendRepresentativeMemoryLabelCacheItem::LABEL_CACHE_ITEM_ASSOCIATABLE_TYPE_COUNT]; |
| 170 |
CBackendRepresentativeMemoryCardinalityCacheItem* mCardinalityCacheEntry; |
| 171 |
|
| 172 |
CBackendRepresentativeMemoryLabelCacheItem* mDetMergedSameConsideredLabelCacheEntry; |
| 173 |
|
| 174 |
cint64 mIndiID; |
| 175 |
|
| 176 |
bool mIncompletelyMarked; |
| 177 |
bool mIndirectlyConnectedNominalIndividual; |
| 178 |
bool mIndirectlyConnectedIndividualIntegration; |
| 179 |
|
| 180 |
|
| 181 |
cint64 mProblematicLevel; |
| 182 |
bool mProblematicLeveledNeighbour; |
| 183 |
|
| 184 |
|
| 185 |
cint64 mAssociationDataUpdateId; |
| 186 |
cint64 mCacheUpdateId; |
| 187 |
cint64 mCacheTouchId; |
| 188 |
cint64 mLastIntegratedIndirectlyConnectedIndividualsChangeId; |
| 189 |
|
| 190 |
CBackendRepresentativeMemoryCacheIndividualNeighbourRoleSetHash* mNeighbourRoleSetHash; |
| 191 |
CBackendRepresentativeMemoryCacheIndividualRoleSetNeighbourArray* mRoleSetNeighbourArray; |
| 192 |
|
| 193 |
cint64 mRepresentativeSameIndiId; |
| 194 |
cint64 mDeterministicSameIndiId; |
| 195 |
|
| 196 |
|
| 197 |
cint64 mLastPropagationCuttingUpdateId; |
| 198 |
CBackendRepresentativeMemoryCacheIndividualAssociationContext* mMemContext; |
| 199 |
|
| 200 |
CBackendRepresentativeMemoryCacheIndividualAssociationData* mPrevData = nullptr; |
| 201 |
|
| 202 |
|
| 203 |
CBackendRepresentativeMemoryCacheIndividualRoleSetNeighbourIndividualIdLinker* mPropCutRemovedNeighbourIndiLinker; |
| 204 |
|
| 205 |
// private methods |
| 206 |
private: |
| 207 |
|
| 208 |
// private variables |
| 209 |
private: |
| 210 |
|
| 211 |
}; |
| 212 |
|
| 213 |
}; // end namespace Cache |
| 214 |
|
| 215 |
}; // end namespace Kernel |
| 216 |
|
| 217 |
}; // end namespace Reasoner |
| 218 |
|
| 219 |
}; // end namespace Konclude |
| 220 |
|
| 221 |
#endif // KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCACHEINDIVIDUALASSOCIATIONDATA_H |