Debian Codegraph @

Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCacheEntry.cpp

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 #include "CReuseCompletionGraphCacheEntry.h"
22
23
24 namespace Konclude {
25
26 namespace Reasoner {
27
28 namespace Kernel {
29
30 namespace Cache {
31
32
33 CReuseCompletionGraphCacheEntry::CReuseCompletionGraphCacheEntry(CReuseCompletionGraphCacheContext* context) : mContext(context),mIncompatibleValues(context),mEntailedValues(context) {
34 mJobInstance = nullptr;
35 mEntryID = 0;
36 }
37
38 CCACHINGSET<CCacheValue>* CReuseCompletionGraphCacheEntry::getIncompatibleValues() {
39 return &mIncompatibleValues;
40 }
41
42 CCACHINGSET<CCacheValue>* CReuseCompletionGraphCacheEntry::getEntailedValues() {
43 return &mEntailedValues;
44 }
45
46 CCACHINGSET<CCacheValue>* CReuseCompletionGraphCacheEntry::getMinimalValues() {
47 return &mMinimalValues;
48 }
49
50 CSatisfiableCalculationJobInstantiation* CReuseCompletionGraphCacheEntry::getJobInstantiation() {
51 return mJobInstance;
52 }
53
54
55 CReuseCompletionGraphCacheEntry* CReuseCompletionGraphCacheEntry::setJobInstantiation(CSatisfiableCalculationJobInstantiation* jobInstantiation) {
56 mJobInstance = jobInstantiation;
57 return this;
58 }
59
60 CReuseCompletionGraphCacheEntry* CReuseCompletionGraphCacheEntry::setEntailedValues(CCACHINGSET<CCacheValue>* valueSet) {
61 if (valueSet) {
62 mEntailedValues += *valueSet;
63 }
64 return this;
65 }
66
67 CReuseCompletionGraphCacheEntry* CReuseCompletionGraphCacheEntry::addEntailedValue(const CCacheValue& cacheValue) {
68 mEntailedValues.insert(cacheValue);
69 return this;
70 }
71
72
73 CReuseCompletionGraphCacheEntry* CReuseCompletionGraphCacheEntry::setIncompatibleValues(CCACHINGSET<CCacheValue>* valueSet) {
74 if (valueSet) {
75 mIncompatibleValues += *valueSet;
76 }
77 return this;
78 }
79
80 CReuseCompletionGraphCacheEntry* CReuseCompletionGraphCacheEntry::addIncompatibleValue(const CCacheValue& cacheValue) {
81 mIncompatibleValues.insert(cacheValue);
82 return this;
83 }
84
85
86 CReuseCompletionGraphCacheEntry* CReuseCompletionGraphCacheEntry::setMinimalValues(CCACHINGSET<CCacheValue>* valueSet) {
87 if (valueSet) {
88 mMinimalValues += *valueSet;
89 }
90 return this;
91 }
92
93 CReuseCompletionGraphCacheEntry* CReuseCompletionGraphCacheEntry::addMinimalValue(const CCacheValue& cacheValue) {
94 mMinimalValues.insert(cacheValue);
95 return this;
96 }
97
98 bool CReuseCompletionGraphCacheEntry::hasMinimalValue(const CCacheValue& cacheValue) {
99 return mMinimalValues.contains(cacheValue);
100 }
101
102
103 CReuseCompletionGraphCacheEntry* CReuseCompletionGraphCacheEntry::setEntryID(cint64 id) {
104 mEntryID = id;
105 return this;
106 }
107
108 cint64 CReuseCompletionGraphCacheEntry::getEntryID() {
109 return mEntryID;
110 }
111
112 }; // end namespace Cache
113
114 }; // end namespace Kernel
115
116 }; // end namespace Reasoner
117
118 }; // end namespace Konclude