Debian Codegraph @

Source/Reasoner/Realizer/COptimizedRepresentativeKPSetSingleNeighbourRoleSetCacheLabelItemData.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 "COptimizedRepresentativeKPSetSingleNeighbourRoleSetCacheLabelItemData.h"
22
23
24 namespace Konclude {
25
26 namespace Reasoner {
27
28 namespace Realizer {
29
30
31 COptimizedRepresentativeKPSetSingleNeighbourRoleSetCacheLabelItemData::COptimizedRepresentativeKPSetSingleNeighbourRoleSetCacheLabelItemData() {
32 mPossibleInstances = false;
33 }
34
35
36 bool COptimizedRepresentativeKPSetSingleNeighbourRoleSetCacheLabelItemData::hasPossibleInstances() {
37 return mPossibleInstances;
38 }
39
40 COptimizedRepresentativeKPSetSingleNeighbourRoleSetCacheLabelItemData* COptimizedRepresentativeKPSetSingleNeighbourRoleSetCacheLabelItemData::setPossibleInstances(bool possibleInstances) {
41 mPossibleInstances = possibleInstances;
42 return this;
43 }
44
45 QHash<COptimizedKPSetRoleInstancesItem*, COptimizedRepresentativeKPSetSingleNeighbourRoleSetCacheLabelItemInstancesData*>* COptimizedRepresentativeKPSetSingleNeighbourRoleSetCacheLabelItemData::getInstancesItemDataHash() {
46 return &mInstancesItemDataHash;
47 }
48
49 COptimizedRepresentativeKPSetSingleNeighbourRoleSetCacheLabelItemInstancesData* COptimizedRepresentativeKPSetSingleNeighbourRoleSetCacheLabelItemData::getInstancesItemData(COptimizedKPSetRoleInstancesItem* instanceItem, bool createIfNotExists) {
50 COptimizedRepresentativeKPSetSingleNeighbourRoleSetCacheLabelItemInstancesData*& instancesData = mInstancesItemDataHash[instanceItem];
51 if (!instancesData && createIfNotExists) {
52 instancesData = new COptimizedRepresentativeKPSetSingleNeighbourRoleSetCacheLabelItemInstancesData();
53 }
54 return instancesData;
55 }
56
57 QList<COptimizedKPSetRoleInstancesItem*>* COptimizedRepresentativeKPSetSingleNeighbourRoleSetCacheLabelItemData::getKnownInstancesItemList(bool inverse) {
58 if (!inverse) {
59 return &mKnownInstancesItemList;
60 } else {
61 return &mKnownInverseInstancesItemList;
62 }
63 }
64
65 QList<COptimizedKPSetRoleInstancesItem*>* COptimizedRepresentativeKPSetSingleNeighbourRoleSetCacheLabelItemData::getPossibleInstancesItemList(bool inverse) {
66 if (!inverse) {
67 return &mPossibleInstancesItemList;
68 } else {
69 return &mPossibleInverseInstancesItemList;
70 }
71 }
72
73
74 QList<COptimizedRepresentativeKPSetCombinedNeighbourRoleSetCacheLabelItemData*>* COptimizedRepresentativeKPSetSingleNeighbourRoleSetCacheLabelItemData::getReferencingCombinedNeighbourRoleLabelItemDataList() {
75 return &mReferencingCombinedNeighbourRoleLabelItemDataList;
76 }
77
78 COptimizedRepresentativeKPSetSingleNeighbourRoleSetCacheLabelItemData* COptimizedRepresentativeKPSetSingleNeighbourRoleSetCacheLabelItemData::addReferencingCombinedNeighbourRoleLabelDataItem(COptimizedRepresentativeKPSetCombinedNeighbourRoleSetCacheLabelItemData* itemData) {
79 mReferencingCombinedNeighbourRoleLabelItemDataList.append(itemData);
80 return this;
81 }
82
83
84 COptimizedRepresentativeKPSetSingleNeighbourRoleSetCacheLabelItemData* COptimizedRepresentativeKPSetSingleNeighbourRoleSetCacheLabelItemData::addKnownInstancesItem(COptimizedKPSetRoleInstancesItem* roleItem, bool inverse) {
85 if (!inverse) {
86 mKnownInstancesItemList.append(roleItem);
87 } else {
88 mKnownInverseInstancesItemList.append(roleItem);
89 }
90 return this;
91 }
92
93
94 COptimizedRepresentativeKPSetSingleNeighbourRoleSetCacheLabelItemData* COptimizedRepresentativeKPSetSingleNeighbourRoleSetCacheLabelItemData::addPossibleInstancesItem(COptimizedKPSetRoleInstancesItem* roleItem, bool inverse) {
95 if (!inverse) {
96 mPossibleInstancesItemList.append(roleItem);
97 } else {
98 mPossibleInverseInstancesItemList.append(roleItem);
99 }
100 return this;
101 }
102
103
104 }; // end namespace Realizer
105
106 }; // end namespace Reasoner
107
108 }; // end namespace Konclude