Debian Codegraph @

Source/Concurrent/CEventAllocator.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_CONCURRENT_CEVENTALLOCATOR_H
22 #define KONCLUDE_CONCURRENT_CEVENTALLOCATOR_H
23
24 // Library includes
25
26
27 // Namespace includes
28 #include "ConcurrentSettings.h"
29
30 // Other includes
31 #include "Utilities/Memory/CObjectMemoryPoolAllocator.h"
32 #include "Utilities/Memory/CMemoryTemporaryAllocationManager.h"
33 #include "Utilities/Memory/CMemoryPool.h"
34
35 // Logger includes
36 #include "Logger/CLogger.h"
37
38
39 namespace Konclude {
40
41 using namespace Utilities::Memory;
42
43 namespace Concurrent {
44
45
46 /*!
47 *
48 * \class CEventAllocator
49 * \author Andreas Steigmiller
50 * \version 0.1
51 * \brief TODO
52 *
53 */
54 template<class T>
55 class CEventAllocator : public CObjectMemoryPoolAllocator<T> {
56 // public methods
57 public:
58 //! Constructor
59 CEventAllocator() {
60 }
61
62 //! Destructor
63 virtual ~CEventAllocator() {
64 }
65
66 static inline T* allocateAndConstructEvent(CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) {
67 T* object = 0;
68 object = CObjectMemoryPoolAllocator<T>::allocateAndConstructWithMemroyPool(memoryTmpAllocatorManager);
69 return object;
70 }
71
72 static inline T* allocateAndConstructEvent(CMemoryPool* memoryPool) {
73 T* object = 0;
74 object = CObjectMemoryPoolAllocator<T>::allocateAndConstructWithMemroyPool(memoryPool);
75 return object;
76 }
77
78 // protected methods
79 protected:
80
81 // protected variables
82 protected:
83
84 // private methods
85 private:
86
87 // private variables
88 private:
89 };
90
91
92
93 }; // end namespace Concurrent
94
95 }; // end namespace Konclude
96
97 #include "CEventAllocator.cpp"
98
99 #endif // KONCLUDE_CONCURRENT_CEVENTALLOCATOR_H