Debian Codegraph @

Source/Utilities/Container/CModelDataArray.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_CMODELDATAARRAY_H
22 #define KONCLUDE_UTILITIES_CONTAINER_CMODELDATAARRAY_H
23
24 // Libraries includes
25
26
27 // Namespace includes
28 #include "ContainerSettings.h"
29 #include "CModelData.h"
30 #include "CDataArrayMemoryManager.h"
31
32 // Other includes
33 #include "Utilities/CMath.h"
34
35 // Logger includes
36 #include "Logger/CLogger.h"
37
38
39 namespace Konclude {
40
41 namespace Utilities {
42
43 namespace Container {
44
45 /*!
46 *
47 * \class CModelDataArray
48 * \author Andreas Steigmiller
49 * \version 0.1
50 * \brief TODO
51 *
52 */
53 class CModelDataArray : public CModelData {
54 // public methods
55 public:
56 //! Constructor
57 CModelDataArray();
58 CModelDataArray(qint64 tagBegin, qint64 tagBegEndSize);
59
60 //! Destructor
61 virtual ~CModelDataArray();
62
63 virtual CModelDataArray *init(qint64 tagBegin = 0, qint64 tagBegEndSize = 64);
64
65 virtual qint64 getBeginTag();
66 virtual qint64 getEndTag();
67 virtual qint64 getTagSize();
68 virtual qint64 getDataArray();
69
70 virtual bool isBaseLevel();
71 virtual qint64 getModelLevel();
72
73 virtual CModelDataArray *setBounds(qint64 tagBegin = 0, qint64 tagBegEndSize = 64);
74
75 virtual CModelDataArray *setData(bool value = false);
76 virtual CModelDataArray *setLevelData(bool value = false);
77
78 virtual CModelDataArray *getBaseModel(qint64 beginTag);
79
80 virtual bool setFlag(qint64 tag, bool flag, CDataArrayMemoryManager *modelMemMan);
81 virtual bool setFlag(qint64 tag, bool flag = true);
82 virtual bool getFlag(qint64 tag);
83
84 virtual bool setLevelFlag(qint64 tag, bool flag = true);
85 virtual bool getLevelFlag(qint64 tag);
86 virtual bool setLevelFlagIndex(qint64 index, bool flag = true);
87 virtual bool getLevelFlagIndex(qint64 index);
88
89 virtual qint64 getFirstFlagTag();
90 virtual qint64 getLastFlagTag();
91
92 virtual bool isEmpty();
93
94 virtual CModelDataArray *intersectWith(CModelDataArray *modelData, bool *flagModification = 0);
95 virtual CModelDataArray *unionWith(CModelDataArray *modelData, bool *flagModification = 0);
96 virtual CModelDataArray *intersectWith(CModelDataArray *modelData, CDataArrayMemoryManager *modelMemMan, bool *flagModification = 0);
97 virtual CModelDataArray *unionWith(CModelDataArray *modelData, CDataArrayMemoryManager *modelMemMan, bool *flagModification = 0);
98
99 virtual CModelDataArray *copyFrom(CModelDataArray *modelData, bool *flagModification = 0);
100 virtual CModelDataArray *copyFrom(CModelDataArray *modelData, CDataArrayMemoryManager *modelMemMan, bool *flagModification = 0);
101
102 virtual qint64 countFlags();
103
104 virtual bool hasIntersectionWith(CModelDataArray *modelData);
105 virtual qint64 countIntersectionWith(CModelDataArray *modelData);
106 virtual bool isSubsetFrom(CModelDataArray *modelData);
107 virtual bool isSuperSetTo(CModelDataArray *modelData);
108
109 virtual bool needsExtension(qint64 minBegTag, qint64 minEndTag);
110 virtual bool needsExtension(qint64 tag);
111 virtual bool needsExtension(CModelDataArray *otherModelData);
112
113 virtual bool isFullConstructed();
114
115 // protected methods
116 protected:
117
118 // protected variables
119 protected:
120 static const qint64 dataSize = 64;
121 static const qint64 log2DataSize = 6;
122 qint64 dataArray;
123
124 qint64 begTag;
125 qint64 endTag;
126 qint64 tagSize;
127
128 qint64 bitIndMask;
129 qint64 bitIndShift;
130
131
132 // private methods
133 private:
134
135 // private variables
136 private:
137
138 };
139
140
141 }; // end namespace Container
142
143 }; // end namespace Utilities
144
145 }; // end namespace Konclude
146
147 #endif // KONCLUDE_UTILITIES_CONTAINER_CMODELDATAARRAY_H