Debian Codegraph @

Source/Control/Command/Instructions/CConstructWriteCustomQueryCommand.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 "CConstructWriteCustomQueryCommand.h"
22
23
24 namespace Konclude {
25
26 namespace Control {
27
28 namespace Command {
29
30 namespace Instructions {
31
32 CConstructWriteCustomQueryCommand::CConstructWriteCustomQueryCommand(CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CWriteQuery::WRITEQUERYTYPE queryType, CWriteQuerySerializer* serializer, const QString& entityRestrictionString, CCommand *parentSuperCommand)
33 : CPreconditionCommand(parentSuperCommand) {
34
35 revProvider = ontologyRevisionProviderCommand;
36 query = 0;
37 mQueryType = queryType;
38 mSerializer = serializer;
39 mEntityRestrictionString = entityRestrictionString;
40 addCommandPrecondition(new CCommandProcessedPrecondition(revProvider->getCommand()));
41 }
42
43
44 CConstructWriteCustomQueryCommand::~CConstructWriteCustomQueryCommand() {
45 delete query;
46 }
47
48 qint64 CConstructWriteCustomQueryCommand::getCommandTag() {
49 return CONSTRUCTWRITECUSTOMQUERYCOMMAND;
50 }
51
52
53 QString CConstructWriteCustomQueryCommand::getBriefCommandDescription() {
54 return QString("Construct-Write-Custom-Query Command");
55 }
56
57
58 CQuery *CConstructWriteCustomQueryCommand::getQuery() {
59 return query;
60 }
61
62 CCommand *CConstructWriteCustomQueryCommand::getCommand() {
63 return this;
64 }
65
66
67 CConstructWriteCustomQueryCommand *CConstructWriteCustomQueryCommand::setQuery(CQuery *knowledgeBaseQuery) {
68 query = knowledgeBaseQuery;
69 return this;
70 }
71
72 COntologyRevision *CConstructWriteCustomQueryCommand::getOntologyRevision() {
73 COntologyRevision *rev = 0;
74 if (revProvider) {
75 rev = revProvider->getOntologyRevision();
76 }
77 return rev;
78 }
79
80
81 CWriteQuerySerializer* CConstructWriteCustomQueryCommand::getWriteQuerySerializer() {
82 return mSerializer;
83 }
84
85 CWriteQuery::WRITEQUERYTYPE CConstructWriteCustomQueryCommand::getWriteQueryType() {
86 return mQueryType;
87 }
88
89 const QString CConstructWriteCustomQueryCommand::getEntityRestrictionString() {
90 return mEntityRestrictionString;
91 }
92
93
94
95 }; // end namespace Instructions
96
97 }; // end namespace Command
98
99 }; // end namespace Control
100
101 }; // end namespace Konclude