Debian Codegraph @

Source/Test/CMemoryAccessThread.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_CMEMORYACCESSTHREAD_H
22 #define KONCLUDE_TEST_CMEMORYACCESSTHREAD_H
23
24 // Libraries includes
25 #include <QThread>
26
27
28 // Namespace includes
29
30
31 // Other includes
32 #include "Utilities/Container/CQtHash.h"
33 #include "Utilities/Container/CQtManagedRestrictedModificationHash.h"
34
35 #include "Utilities/Memory/CObjectAllocator.h"
36 #include "Utilities/Memory/CMemoryPoolAllocationManager.h"
37
38 #include "Utilities/UtilitiesSettings.h"
39
40 #include "Context/CContextBase.h"
41
42 // Logger includes
43 #include "Logger/CLogger.h"
44
45
46
47 namespace Konclude {
48
49 using namespace Context;
50 using namespace Utilities;
51 using namespace Utilities::Container;
52 using namespace Utilities::Memory;
53
54 namespace Test {
55
56
57 /*!
58 *
59 * \class CMemoryAccessThread
60 * \author Andreas Steigmiller
61 * \version 0.1
62 * \brief TODO
63 *
64 */
65 class CMemoryAccessThread : public QThread {
66 // public methods
67 public:
68 //! Constructor
69 CMemoryAccessThread(cint64 readWriteRatio, int* accessArray, cint64 arraySize, bool atomicOperations, cint64 minWriteIndex, cint64 maxWriteIndex, CMemoryPoolProvider* memoryPoolProvider);
70
71 //! Destructor
72 virtual ~CMemoryAccessThread();
73
74 virtual void startModifications();
75 virtual void stopModifications();
76
77 cint64 getModificationStepsCount();
78
79
80 // protected methods
81 protected:
82 virtual void run();
83
84 // protected variables
85 protected:
86 int* mMemoryAccessArray;
87 cint64 mArraySize;
88
89 CMemoryPoolProvider* mMemoryPoolProvider;
90 CMemoryPoolAllocationManager* mMemoryPoolAllocationMan;
91 CContextBase* mContextBase;
92
93 bool mCanceled;
94 cint64 mReadWriteRatio;
95 cint64 mModificationSteps;
96
97 bool mAtomicIncrements;
98
99 bool mLocalWrite;
100 cint64 mLocalWriteStep;
101 cint64 mLocalWriteIndex;
102
103 cint64 mMinWriteIndex;
104 cint64 mMaxWriteIndex;
105
106 // private methods
107 private:
108
109 // private variables
110 private:
111
112 };
113
114 }; // end namespace Test
115
116 }; // end namespace Konclude
117
118 using namespace Konclude::Test;
119
120 #endif // KONCLUDE_TEST_CMEMORYACCESSTHREAD_H