Debian Codegraph @

Source/Reasoner/Kernel/Algorithm/CComputedConsequencesCacheHandler.h

raw
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_ALGORITHM_CCOMPUTEDCONSEQUENCESCACHEHANDLER_H
22 #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CCOMPUTEDCONSEQUENCESCACHEHANDLER_H
23
24 // Libraries includes
25
26
27 // Namespace includes
28 #include "AlgorithmSettings.h"
29 #include "CCalculationAlgorithmContext.h"
30
31 // Other includes
32 #include "Reasoner/Ontology/CIndividual.h"
33 #include "Reasoner/Ontology/CConcept.h"
34
35 #include "Reasoner/Kernel/Cache/CComputedConsequencesCacheReader.h"
36 #include "Reasoner/Kernel/Cache/CComputedConsequencesCacheWriter.h"
37 #include "Reasoner/Kernel/Cache/CComputedConsequencesCacheEntry.h"
38 #include "Reasoner/Kernel/Cache/CComputedConsequencesCacheWriteData.h"
39
40 #include "Context/CContextBase.h"
41
42 #include "Reasoner/Kernel/Task/CConsistenceTaskData.h"
43
44 // Logger includes
45 #include "Logger/CLogger.h"
46
47
48
49 namespace Konclude {
50
51 using namespace Context;
52
53 namespace Reasoner {
54
55 using namespace Ontology;
56
57 namespace Kernel {
58
59 using namespace Cache;
60 using namespace Task;
61
62 namespace Algorithm {
63
64 /*!
65 *
66 * \class CComputedConsequencesCacheHandler
67 * \author Andreas Steigmiller
68 * \version 0.1
69 * \brief TODO
70 *
71 */
72 class CComputedConsequencesCacheHandler {
73 // public methods
74 public:
75 //! Constructor
76 CComputedConsequencesCacheHandler(CComputedConsequencesCacheReader* satCacheReader, CComputedConsequencesCacheWriter* satCacheWriter);
77
78 bool tryCacheTypeConcept(CIndividual* individual, CConcept* concept, bool negation, CCalculationAlgorithmContext* calcAlgContext);
79 CSortedNegLinker<CConcept*>* getCachedTypesConceptLinker(CIndividual* individual, CCalculationAlgorithmContext* calcAlgContext);
80
81
82 bool commitCacheMessages(CCalculationAlgorithmContext* calcAlgContext);
83
84 // protected methods
85 protected:
86 bool prepareCacheMessages(CCalculationAlgorithmContext* calcAlgContext);
87 bool addCacheMessages(CComputedConsequencesCacheWriteData* expandWriteData, CCalculationAlgorithmContext* calcAlgContext);
88
89 bool canCacheTypeConcept(CIndividual* individual, CConcept* concept, bool negation, CCalculationAlgorithmContext* calcAlgContext);
90
91 // protected variables
92 protected:
93 CComputedConsequencesCacheReader* mSatCacheReader;
94 CComputedConsequencesCacheWriter* mSatCacheWriter;
95
96 CComputedConsequencesCacheWriteData* mWriteData;
97 CTaskMemoryPoolAllocationManager* mMemAllocMan;
98 CMemoryPoolContainer mMemPoolCon;
99 CContextBase* mTmpContext;
100
101
102 // private methods
103 private:
104
105 // private variables
106 private:
107
108 };
109
110 }; // end namespace Algorithm
111
112 }; // end namespace Kernel
113
114 }; // end namespace Reasoner
115
116 }; // end namespace Konclude
117
118 #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CCOMPUTEDCONSEQUENCESCACHEHANDLER_H