Debian Codegraph @

Source/Reasoner/Answerer/CFirstQueuedAnsweringHandlerProvider.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_REASONER_ANSWERER_CFIRSTQUEUEDANSWERINGHANDLERPROVIDER_H
22 #define KONCLUDE_REASONER_ANSWERER_CFIRSTQUEUEDANSWERINGHANDLERPROVIDER_H
23
24 // Libraries includes
25 #include <QLinkedList>
26
27 // Namespace includes
28 #include "AnswererSettings.h"
29 #include "CAnsweringHandlerProvider.h"
30 #include "CAnsweringHandlerFactory.h"
31 #include "CAnsweringStatisticsCollectionStrings.h"
32
33
34 // Other includes
35 #include "Reasoner/Query/CComplexAnsweringQuery.h"
36 #include "Reasoner/Query/CComplexAnsweringCompositionQuery.h"
37
38
39
40
41 // Logger includes
42 #include "Logger/CLogger.h"
43 #include "Logger/CLogIdentifier.h"
44
45
46
47
48
49 namespace Konclude {
50
51 namespace Reasoner {
52
53 using namespace Query;
54
55 namespace Answerer {
56
57
58
59 /*!
60 *
61 * \class CFirstQueuedAnsweringHandlerProvider
62 * \author Andreas Steigmiller
63 * \version 0.1
64 * \brief TODO
65 *
66 */
67 class CFirstQueuedAnsweringHandlerProvider : public CAnsweringHandlerProvider {
68 // public methods
69 public:
70 //! Constructor
71 CFirstQueuedAnsweringHandlerProvider(CAnsweringHandlerFactory* answeringHandlerFactory);
72
73 //! Destructor
74 virtual ~CFirstQueuedAnsweringHandlerProvider();
75
76 virtual CAnsweringHandler* getAnsweringHandler(CComplexAnsweringQuery* complexAnsweringQuery);
77 virtual CAnsweringHandler* getAnsweringHandler(CConcreteOntology* ontology, bool composedQuery);
78
79
80 virtual CAnsweringHandlerProvider* releaseAnsweringHandler(CAnsweringHandler* answeringHandler);
81
82 virtual CAnsweringHandlerProvider* addAnsweringStatistics(CConcreteOntology* ontology, CAnsweringStatistics* stats);
83
84 // protected methods
85 protected:
86
87 // protected variables
88 protected:
89
90 class CAnsweringHandlerData {
91 public:
92 QList<CAnsweringHandler*> mQueuedHandlerList;
93 QSet<CAnsweringHandler*> mProcessingHandlerSet;
94 bool mStatisticsCollection = false;
95 CAnsweringStatisticsCollectionStrings* mCollectedStats = nullptr;
96 };
97
98 QHash<CConcreteOntology*, CAnsweringHandlerData*> mOntoloyHandlerDataHash;
99 QHash<CAnsweringHandler*, CAnsweringHandlerData*> mHandlerHandlerDataHash;
100 CAnsweringHandlerFactory* mAnsweringHandlerFactory;
101
102
103 // private methods
104 private:
105
106 // private variables
107 private:
108
109 };
110
111 }; // end namespace Answerer
112
113 }; // end namespace Reasoner
114
115 }; // end namespace Konclude
116
117 #endif // KONCLUDE_REASONER_ANSWERER_CFIRSTQUEUEDANSWERINGHANDLERPROVIDER_H