Debian Codegraph @

Source/Reasoner/Ontology/COntologyDataBoxes.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 "COntologyDataBoxes.h"
22
23
24 namespace Konclude {
25
26 namespace Reasoner {
27
28 namespace Ontology {
29
30
31 COntologyDataBoxes::COntologyDataBoxes(CBoxContext* boxContext) {
32 mBoxContext = boxContext;
33 mTBox = CObjectParameterizingAllocator< CTBox,CBoxContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext);
34 mRBox = CObjectParameterizingAllocator< CRBox,CBoxContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext);
35 mABox = CObjectParameterizingAllocator< CABox,CBoxContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext);
36 mMBox = CObjectParameterizingAllocator< CMBox,CBoxContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext);
37 mExpDataBoxMapping = CObjectParameterizingAllocator< CExpressionDataBoxMapping,CBoxContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext);
38
39 mBasicBuild = false;
40 mInitialBuild = false;
41 mIterationBuild = false;
42 mPrevOntBasicBuild = false;
43 mPrevOntInitialBuild = false;
44 mPrevOntIterationBuild = false;
45
46 mValueSpaceTypes = CDatatypeValueSpaceTypes::getValueSpaceTypes();
47 }
48
49
50
51 COntologyDataBoxes::~COntologyDataBoxes() {
52 COPADestroyAndRelease(mTBox,CContext::getMemoryAllocationManager(mBoxContext));
53 COPADestroyAndRelease(mRBox,CContext::getMemoryAllocationManager(mBoxContext));
54 COPADestroyAndRelease(mABox,CContext::getMemoryAllocationManager(mBoxContext));
55 COPADestroyAndRelease(mMBox,CContext::getMemoryAllocationManager(mBoxContext));
56 COPADestroyAndRelease(mExpDataBoxMapping,CContext::getMemoryAllocationManager(mBoxContext));
57 }
58
59
60 COntologyDataBoxes* COntologyDataBoxes::referenceDataBoxes(COntologyDataBoxes* dataBoxes) {
61 mTBox->referenceTBox(dataBoxes->mTBox);
62 mRBox->referenceRBox(dataBoxes->mRBox);
63 mABox->referenceABox(dataBoxes->mABox);
64 mMBox->referenceMBox(dataBoxes->mMBox);
65 mExpDataBoxMapping->referenceDataBoxMapping(dataBoxes->mExpDataBoxMapping);
66 mBasicBuild = dataBoxes->mBasicBuild;
67 mInitialBuild = dataBoxes->mInitialBuild;
68 mIterationBuild = dataBoxes->mIterationBuild;
69 mPrevOntBasicBuild = mBasicBuild;
70 mPrevOntInitialBuild = mInitialBuild;
71 mPrevOntIterationBuild = mIterationBuild;
72 return this;
73 }
74
75 CConcept *COntologyDataBoxes::getTopConcept() {
76 return mTBox->getTopConcept();
77 }
78
79 CConcept *COntologyDataBoxes::getBottomConcept() {
80 return mTBox->getBottomConcept();
81 }
82
83 CTBox* COntologyDataBoxes::getTBox() {
84 return mTBox;
85 }
86
87 CRBox* COntologyDataBoxes::getRBox() {
88 return mRBox;
89 }
90
91 CABox* COntologyDataBoxes::getABox() {
92 return mABox;
93 }
94
95 CMBox* COntologyDataBoxes::getMBox() {
96 return mMBox;
97 }
98
99 CBoxContext* COntologyDataBoxes::getBoxContext() {
100 return mBoxContext;
101 }
102
103
104 CExpressionDataBoxMapping* COntologyDataBoxes::getExpressionDataBoxMapping() {
105 return mExpDataBoxMapping;
106 }
107
108 COntologyDataBoxes* COntologyDataBoxes::setExpressionDataBoxMapping(CExpressionDataBoxMapping* expDatBoxMapping) {
109 mExpDataBoxMapping = expDatBoxMapping;
110 return this;
111 }
112
113 bool COntologyDataBoxes::isBasicBuild() {
114 return mBasicBuild;
115 }
116
117 bool COntologyDataBoxes::isInitialBuild() {
118 return mInitialBuild;
119 }
120
121 bool COntologyDataBoxes::isIterationBuild() {
122 return mIterationBuild;
123 }
124
125
126 COntologyDataBoxes* COntologyDataBoxes::setBasicBuild(bool basicBuild) {
127 mBasicBuild = basicBuild;
128 return this;
129 }
130
131 COntologyDataBoxes* COntologyDataBoxes::setInitialBuild(bool initialBuild) {
132 mInitialBuild = initialBuild;
133 return this;
134 }
135
136 COntologyDataBoxes* COntologyDataBoxes::setIterationBuild(bool iterationBuild) {
137 mIterationBuild = iterationBuild;
138 return this;
139 }
140
141 COntologyDataBoxes* COntologyDataBoxes::setBuildContinuation() {
142 mBasicBuild = false;
143 mInitialBuild = false;
144 mIterationBuild = false;
145 if (mPrevOntIterationBuild) {
146 mIterationBuild = true;
147 } else if (mPrevOntInitialBuild) {
148 mIterationBuild = true;
149 } else if (mPrevOntBasicBuild) {
150 mInitialBuild = true;
151 }
152 return this;
153 }
154
155
156 CDatatypeValueSpaceTypes* COntologyDataBoxes::getDatatypeValueSpaceTypes() {
157 return mValueSpaceTypes;
158 }
159
160
161 }; // end namespace Ontology
162
163 }; // end namespace Reasoner
164
165 }; // end namespace Konclude