Debian Codegraph @

Source/Control/Command/Instructions/CLoadKnowledgeBaseFinishDownloadCommand.h

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 #ifndef KONCLUDE_CONTROL_COMMAND_CLOADKNOWLEDGEBASEFINISHDOWNLOADCOMMAND_H
22 #define KONCLUDE_CONTROL_COMMAND_CLOADKNOWLEDGEBASEFINISHDOWNLOADCOMMAND_H
23
24 // Libraries includes
25 #include <QByteArray>
26 #include <QIODevice>
27
28 // Namespace includes
29 #include "CKnowledgeBaseRevisionCommandProvider.h"
30 #include "CLoadKnowledgeBaseAllDownloadedContinuer.h"
31
32
33 // Other includes
34 #include "Control/Command/CommandSettings.h"
35 #include "Control/Command/CCommand.h"
36 #include "Control/Command/CPreconditionCommand.h"
37 #include "Control/Command/CCommandProcessedPrecondition.h"
38 #include "Control/Command/CPreconditionSynchronizer.h"
39
40
41 #include "Concurrent/Callback/CCallbackData.h"
42
43 #include "Network/HTTP/CHttpResponse.h"
44
45
46
47 // Logger includes
48 #include "Logger/CLogger.h"
49
50 using namespace Konclude::Logger;
51
52
53 namespace Konclude {
54
55 using namespace Concurrent::Callback;
56 using namespace Network::HTTP;
57
58 namespace Control {
59
60 namespace Command {
61
62 namespace Instructions {
63
64 /*!
65 *
66 * \class CLoadKnowledgeBaseFinishDownloadCommand
67 * \author Andreas Steigmiller
68 * \version 0.1
69 * \brief TODO
70 *
71 */
72 class CLoadKnowledgeBaseFinishDownloadCommand : public CPreconditionCommand, public CCallbackData {
73 // public methods
74 public:
75 //! Constructor
76 CLoadKnowledgeBaseFinishDownloadCommand(const QString& downloadString, QIODevice* writeDevice, CPreconditionSynchronizer *preSynchronizer, CCommand *parentSuperCommand = 0);
77
78 //! Destructor
79 virtual ~CLoadKnowledgeBaseFinishDownloadCommand();
80
81 virtual qint64 getCommandTag();
82 virtual QString getBriefCommandDescription();
83
84
85 virtual void doCallback();
86
87 CLoadKnowledgeBaseFinishDownloadCommand* setTemporaryDataPointer(QByteArray* dataPointer);
88 CLoadKnowledgeBaseFinishDownloadCommand* setResponse(CHttpResponse* response);
89
90 QByteArray* getTemporaryDataPointer(bool take = false);
91 QIODevice* getWriteIODevice();
92 CHttpResponse* getResponse();
93
94 QString getDownloadString();
95
96
97
98 // protected methods
99 protected:
100
101 // protected variables
102 protected:
103 QString mDownloadString;
104 CHttpResponse* mResponse;
105 QByteArray* mTmpDataPointer;
106 QIODevice* mWriteDevice;
107 CPreconditionSynchronizer* mPreSynchronizer;
108
109
110 // private methods
111 private:
112
113 // private variables
114 private:
115
116 };
117
118 }; // end namespace Instructions
119
120 }; // end namespace Command
121
122 }; // end namespace Control
123
124 }; // end namespace Konclude
125
126 #endif // KONCLUDE_CONTROL_COMMAND_CLOADKNOWLEDGEBASEFINISHDOWNLOADCOMMAND_H