Debian Codegraph @

Source/Test/CConcurrentThroughputTestTaskTester.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_TEST_CCONCURRENTTHROUGHPUTTESTTASKTESTER_H
22 #define KONCLUDE_TEST_CCONCURRENTTHROUGHPUTTESTTASKTESTER_H
23
24 // Libraries includes
25 #include <QTime>
26 #include <QList>
27 #include <qmath.h>
28
29 // Namespace includes
30 #include "CThroughputTestTask.h"
31 #include "CThroughputTestTaskHandleAlgorithm.h"
32
33 // Other includes
34 #include "Concurrent/Callback/CCallbackData.h"
35
36 #include "Scheduler/CSingleThreadTaskProcessorUnit.h"
37 #include "Scheduler/CTaskEventCommunicator.h"
38
39 #include "Scheduler/CTaskProcessorSchedulerThread.h"
40 #include "Scheduler/CTaskProcessorCompletorThread.h"
41 #include "Scheduler/CTaskProcessorThread.h"
42
43
44 #include "Utilities/Memory/CObjectMemoryPoolAllocator.h"
45
46 // Logger includes
47 #include "Logger/CLogger.h"
48
49
50
51 namespace Konclude {
52
53 using namespace Scheduler;
54 using namespace Utilities::Memory;
55 using namespace Concurrent::Callback;
56
57 namespace Test {
58
59
60 /*!
61 *
62 * \class CConcurrentThroughputTestTaskTester
63 * \author Andreas Steigmiller
64 * \version 0.1
65 * \brief TODO
66 *
67 */
68 class CConcurrentThroughputTestTaskTester : public CCallbackData {
69 // public methods
70 public:
71 //! Constructor
72 CConcurrentThroughputTestTaskTester();
73
74 //! Destructor
75 virtual ~CConcurrentThroughputTestTaskTester();
76
77
78 void generateTestingStructure(cint64 maxBranchDepth, cint64 branchingFactor);
79 void startTesting();
80 void stopTesting();
81
82 cint64 getTaskProcessedCount();
83 void destroyTestingStructure();
84
85 virtual void doCallback();
86
87
88
89
90 // protected methods
91 protected:
92
93 // protected variables
94 protected:
95 CSingleThreadTaskProcessorUnit* mProcessUnit;
96 CTaskProcessorSchedulerThread* mSchedulerUnit;
97 CTaskProcessorCompletorThread* mCompletorUnit;
98 CThroughputTestTaskHandleAlgorithm* mHandleAlg;
99 QList<CTaskProcessorThread*> mProcessorUnitList;
100
101 cint64 mMaxBranchDepth;
102 cint64 mBranchingFactor;
103 cint64 mTotalTestTasks;
104
105 cint64 mThreadTestCount;
106 cint64 mThreadMaxTestCount;
107 cint64 mScaleReferenceTime;
108
109 QTime mMeasurementTimer;
110 cint64 mLastEventProcessed;
111 cint64 mLastTaskProcessed;
112
113
114 // private methods
115 private:
116
117 // private variables
118 private:
119
120 };
121
122 }; // end namespace Test
123
124 }; // end namespace Konclude
125
126 #endif // KONCLUDE_TEST_CCONCURRENTTHROUGHPUTTESTTASKTESTER_H