Debian Codegraph @

Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCacheSlotItem.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_KERNEL_CACHE_CREUSECOMPLETIONGRAPHCACHESLOTITEM_H
22 #define KONCLUDE_REASONER_KERNEL_CACHE_CREUSECOMPLETIONGRAPHCACHESLOTITEM_H
23
24 // Libraries includes
25
26
27 // Namespace includes
28 #include "CacheSettings.h"
29 #include "CReuseCompletionGraphCompatibilityEntryHash.h"
30
31
32 // Other includes
33 #include "Utilities/Memory/CMemoryPoolContainer.h"
34
35 #include "Utilities/Container/CLinker.h"
36
37 // Logger includes
38 #include "Logger/CLogger.h"
39
40
41 namespace Konclude {
42
43 using namespace Utilities::Memory;
44 using namespace Utilities::Container;
45
46 namespace Reasoner {
47
48 namespace Kernel {
49
50 namespace Cache {
51
52 /*!
53 *
54 * \class CReuseCompletionGraphCacheSlotItem
55 * \author Andreas Steigmiller
56 * \version 0.1
57 * \brief TODO
58 *
59 */
60 class CReuseCompletionGraphCacheSlotItem : public CMemoryPoolContainer, public CLinkerBase<CReuseCompletionGraphCacheSlotItem*,CReuseCompletionGraphCacheSlotItem> {
61 // public methods
62 public:
63 //! Constructor
64 CReuseCompletionGraphCacheSlotItem(CMemoryPool* memoryPool = nullptr);
65
66 bool incReader();
67 bool incReader(cint64 incCount);
68 bool decReader();
69
70
71 bool hasCacheReaders();
72
73
74 CReuseCompletionGraphCacheSlotItem* setEntryHash(CReuseCompletionGraphCompatibilityEntryHash* hash);
75 CReuseCompletionGraphCompatibilityEntryHash* getEntryHash();
76
77 cint64 getEntryCount();
78 CReuseCompletionGraphCacheSlotItem* setEntryCount(cint64 entryCount);
79
80
81 // protected methods
82 protected:
83
84 // protected variables
85 protected:
86 CReuseCompletionGraphCompatibilityEntryHash* mEntryHash;
87
88 QAtomicInt mReaderSharingCount;
89 bool mReaderUsing;
90
91 cint64 mEntyCount;
92
93
94 // private methods
95 private:
96
97 // private variables
98 private:
99
100 };
101
102 }; // end namespace Cache
103
104 }; // end namespace Kernel
105
106 }; // end namespace Reasoner
107
108 }; // end namespace Konclude
109
110 #endif // KONCLUDE_REASONER_KERNEL_CACHE_CREUSECOMPLETIONGRAPHCACHESLOTITEM_H