Debian Codegraph @

Source/Reasoner/Query/CComplexAnsweringExpressionQuery.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 "CComplexAnsweringExpressionQuery.h"
22
23
24 namespace Konclude {
25
26 namespace Reasoner {
27
28 namespace Query {
29
30 CComplexAnsweringExpressionQuery::CComplexAnsweringExpressionQuery(CConcreteOntology* baseOntology, CConcreteOntology* expressionOntology, CConfigurationBase* configuration, const QString& queryName)
31 : CComplexAnsweringQuery(baseOntology, expressionOntology, configuration, queryName) {
32 mResultOrdering = nullptr;
33 mResultFiltering = nullptr;
34 }
35
36 CComplexAnsweringExpressionQuery::~CComplexAnsweringExpressionQuery() {
37 }
38
39
40
41 CVariableBindingOrdering* CComplexAnsweringExpressionQuery::getResultOrderingLinker() {
42 return mResultOrdering;
43 }
44
45 CComplexAnsweringExpressionQuery* CComplexAnsweringExpressionQuery::setResultOrderingLinker(CVariableBindingOrdering* odering) {
46 while (mResultOrdering) {
47 CVariableBindingOrdering* tmpOrdering = mResultOrdering;
48 mResultOrdering = mResultOrdering->getNext();
49 delete tmpOrdering;
50 }
51 mResultOrdering = odering;
52 return this;
53 }
54
55 CComplexAnsweringExpressionQuery* CComplexAnsweringExpressionQuery::addResultOrdering(CVariableBindingOrdering* odering) {
56 if (mResultOrdering) {
57 mResultOrdering->append(odering);
58 } else {
59 mResultOrdering = odering;
60 }
61 return this;
62 }
63
64
65 CVariableBindingFiltering* CComplexAnsweringExpressionQuery::getResultFilteringLinker() {
66 return mResultFiltering;
67 }
68
69 CComplexAnsweringExpressionQuery* CComplexAnsweringExpressionQuery::setResultFilteringLinker(CVariableBindingFiltering* filtering) {
70 while (mResultFiltering) {
71 CVariableBindingFiltering* tmpOrdering = mResultFiltering;
72 mResultFiltering = mResultFiltering->getNext();
73 delete tmpOrdering;
74 }
75 mResultFiltering = filtering;
76 return this;
77 }
78
79 CComplexAnsweringExpressionQuery* CComplexAnsweringExpressionQuery::addResultFiltering(CVariableBindingFiltering* filtering) {
80 if (mResultFiltering) {
81 mResultFiltering->append(filtering);
82 } else {
83 mResultFiltering = filtering;
84 }
85 return this;
86 }
87
88 }; // end namespace Query
89
90 }; // end namespace Reasoner
91
92 }; // end namespace Konclude