Debian Codegraph @

Source/Utilities/Memory/CCentralizedAllocationConfigProvidedDependendLimitation.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_UTILITIES_MEMORY_CCENTRALIZEDALLOCATIONCONFIGPROVIDEDDEPENDENDLIMITATION_H
22 #define KONCLUDE_UTILITIES_MEMORY_CCENTRALIZEDALLOCATIONCONFIGPROVIDEDDEPENDENDLIMITATION_H
23
24 // Library includes
25 #include <qglobal.h>
26 #include <qmath.h>
27 #include <QMutex>
28 #include <QMutexLocker>
29
30 // Namespace includes
31 #include "MemorySettings.h"
32 #include "CCentralizedAllocationLimitation.h"
33 #include "CCentralizedAllocationLimitator.h"
34
35
36 // Other includes
37 #include "Config/CConfigurationProvider.h"
38 #include "Config/CConfigDataReader.h"
39
40 // Logger includes
41 #include "Logger/CLogger.h"
42
43
44 namespace Konclude {
45
46 using namespace Config;
47
48 namespace Utilities {
49
50 namespace Memory {
51
52
53 /*!
54 *
55 * \class CCentralizedAllocationConfigProvidedDependendLimitation
56 * \author Andreas Steigmiller
57 * \version 0.1
58 * \brief TODO
59 *
60 */
61 class CCentralizedAllocationConfigProvidedDependendLimitation : public CCentralizedAllocationLimitation {
62 // public methods
63 public:
64 //! Constructor
65 CCentralizedAllocationConfigProvidedDependendLimitation(CConfigurationProvider* configProvider, const QString& configString);
66
67 //! Destructor
68 virtual ~CCentralizedAllocationConfigProvidedDependendLimitation();
69
70 CCentralizedAllocationLimitator* getLimitator();
71
72 virtual cint64 getUpdatedMemoryAllocationLimit(CAllocationLimitator* limitator);
73
74 virtual cint64 getAllocatedMemorySize();
75 virtual cint64 getAllocatedMemorySizeMaximum();
76 virtual cint64 getReservedMemorySizeMaximum();
77
78 // protected methods
79 protected:
80 bool updateMaxMemoryAllocationSize();
81
82 bool requestLimitatorMemoryAllocationSizeUpdate();
83
84
85 // protected variables
86 protected:
87 CConfigurationProvider* mConfigProvider;
88 QString mConfigString;
89
90 bool mMemAllocLimited;
91 cint64 mMaxMemAllocSize;
92 cint64 mAddMemAllocSize;
93 cint64 mCurrMemAllocSize;
94 cint64 mCriticalMemAllocSize;
95
96 CConfiguration* mLastConfig;
97 QMutex mSyncMutex;
98
99 CCentralizedAllocationLimitator* mLimitatorLinker;
100
101
102 cint64 mStatMaxAllocatedMemSize;
103
104 // private methods
105 private:
106
107 // private variables
108 private:
109 };
110
111
112 }; // end namespace Memory
113
114 }; // end namespace Utilities
115
116 }; // end namespace Konclude
117
118 #endif // KONCLUDE_UTILITIES_MEMORY_CCENTRALIZEDALLOCATIONCONFIGPROVIDEDDEPENDENDLIMITATION_H