Debian Codegraph @

Source/Utilities/Container/CDoubleDynamicReferenceVector.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_CONTAINER_CDOUBLEDYNAMICREFERENCEVECTOR_H
22 #define KONCLUDE_UTILITIES_CONTAINER_CDOUBLEDYNAMICREFERENCEVECTOR_H
23
24 // Namespace includes
25 #include "ContainerSettings.h"
26
27 // Library includes
28
29 // Other includes
30 #include "CDynamicReferenceVector.h"
31
32 // Logger includes
33
34
35 namespace Konclude {
36
37 using namespace Context;
38
39 namespace Utilities {
40
41 namespace Container {
42
43
44 /*!
45 *
46 * \class CDoubleDynamicReferenceVectorBase
47 * \author Andreas Steigmiller
48 * \version 0.1
49 * \brief TODO
50 *
51 */
52 template<class T, class S, cint64 bucket2Size = 5>
53 class CDoubleDynamicReferenceVectorBase {
54 // public methods
55 public:
56 //! Constructor
57 inline CDoubleDynamicReferenceVectorBase(CContext* context = nullptr);
58
59 //! Destructor
60 inline ~CDoubleDynamicReferenceVectorBase();
61
62 inline const T getData(cint64 index, const T& defaultValue);
63 inline const T getData(cint64 index, const T& defaultValue, bool* localFlag);
64 inline const T getLocalData(cint64 index, const T& defaultValue);
65 inline const T getReferenceData(cint64 index, const T& defaultValue);
66
67 inline S* setLocalData(cint64 index, const T& data);
68 inline S* setData(cint64 index, const T& data);
69
70 inline bool hasLocalData(cint64 index);
71 inline bool hasData(cint64 index);
72 inline bool hasReferencedData(cint64 index);
73
74 inline S* clear();
75 inline S* referenceVector(CDoubleDynamicReferenceVectorBase<T,S,bucket2Size>* refVector);
76
77 inline cint64 getItemCount();
78 inline cint64 getItemMaxIndex();
79 inline cint64 getItemMinIndex();
80
81 inline cint64 getReferencedItemCount();
82 inline cint64 getReferencedItemMaxIndex();
83 inline cint64 getReferencedItemMinIndex();
84
85 // protected methods
86 protected:
87
88 // protected variables
89 protected:
90 CDynamicReferenceVectorBase<T,S,bucket2Size> mFirstVector,mSecondVector;
91
92
93 // private methods
94 private:
95
96 // private variables
97 private:
98 };
99
100
101
102 /*!
103 *
104 * \class CDoubleDynamicReferenceVector
105 * \author Andreas Steigmiller
106 * \version 0.1
107 * \brief TODO
108 *
109 */
110 template<class T, cint64 bucket2Size = 5>
111 class CDoubleDynamicReferenceVector : public CDoubleDynamicReferenceVectorBase<T,CDoubleDynamicReferenceVector<T,bucket2Size>,bucket2Size> {
112 // public methods
113 public:
114 // Constructor
115 inline CDoubleDynamicReferenceVector(CContext* context = nullptr) : CDoubleDynamicReferenceVectorBase<T,CDoubleDynamicReferenceVector<T,bucket2Size>,bucket2Size>(context) {};
116
117 //! Destructor
118 inline ~CDoubleDynamicReferenceVector() {};
119 };
120
121
122 }; // end namespace Container
123
124 }; // end namespace Utilities
125
126 }; // end namespace Konclude
127
128 #include "CDoubleDynamicReferenceVector.cpp"
129
130 #endif // KONCLUDE_UTILITIES_CONTAINER_CDOUBLEDYNAMICREFERENCEVECTOR_H