Debian Codegraph @

Source/Reasoner/Ontology/CIndividualDependence.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 "CIndividualDependence.h"
22
23
24 namespace Konclude {
25
26 namespace Reasoner {
27
28 namespace Ontology {
29
30
31 CIndividualDependence::CIndividualDependence() {
32 indiDepTag = 0;
33 conceptDepsLinker = 0;
34 }
35
36
37 CIndividualDependence::~CIndividualDependence() {
38 }
39
40
41 CIndividualDependence *CIndividualDependence::init(qint64 indiTag, CIndividualDependence *indiDep, CMemoryManager<CSortedNegLinker<qint64> > *linkerMemMan) {
42 indiDepTag = indiTag;
43 conceptDepsLinker = 0;
44 if (linkerMemMan) {
45 CSortedNegLinker<qint64> *linkIt = 0;
46 if (indiDep) {
47 linkIt = indiDep->conceptDepsLinker;
48 }
49 while (linkIt) {
50 CSortedNegLinker<qint64> *conLink = linkerMemMan->allocate();
51 conLink->init(linkIt->getData(),linkIt->isNegated());
52 addConceptDependenceLinker(conLink);
53 linkIt = (CSortedNegLinker<qint64> *)linkIt->getNext();
54 }
55 }
56 return this;
57 }
58
59 CIndividualDependence *CIndividualDependence::init(CIndividual *indi) {
60 indiDepTag = indi->getIndividualID();
61 conceptDepsLinker = 0;
62 return this;
63 }
64
65
66 qint64 CIndividualDependence::getIndividualDependenceTag() {
67 return indiDepTag;
68 }
69
70 CIndividualDependence *CIndividualDependence::setIndividualDependenceTag(qint64 tag) {
71 indiDepTag = tag;
72 return this;
73 }
74
75 CIndividualDependence *CIndividualDependence::setConceptDependenceList(CSortedNegLinker<qint64> *conceptList) {
76 conceptDepsLinker = conceptList;
77 return this;
78 }
79
80 CIndividualDependence *CIndividualDependence::addConceptDependenceLinker(CSortedNegLinker<qint64> *conceptLinker) {
81 if (conceptDepsLinker) {
82 conceptDepsLinker = conceptDepsLinker->insertSortedNextSorted(conceptLinker);
83 } else {
84 conceptDepsLinker = conceptLinker;
85 }
86 return this;
87 }
88
89 CSortedNegLinker<qint64> *CIndividualDependence::getConceptDependenceList() {
90 return conceptDepsLinker;
91 }
92
93 }; // end namespace Ontology
94
95 }; // end namespace Reasoner
96
97 }; // end namespace Konclude