Changeset View
Changeset View
Standalone View
Standalone View
kdevplatform/language/duchain/topducontextdynamicdata.h
1 | /* This is part of KDevelop | 1 | /* This is part of KDevelop | ||
---|---|---|---|---|---|
2 | Copyright 2008 David Nolden <david.nolden.kdevelop@art-master.de> | 2 | Copyright 2018 R.J.V. Bertin <rjvbertin@gmail.com> | ||
3 | 3 | | |||
4 | This library is free software; you can redistribute it and/or | 4 | This library is free software; you can redistribute it and/or | ||
5 | modify it under the terms of the GNU Library General Public | 5 | modify it under the terms of the GNU Library General Public | ||
Context not available. | |||||
21 | 21 | | |||
22 | #include <QVector> | 22 | #include <QVector> | ||
23 | #include <QByteArray> | 23 | #include <QByteArray> | ||
24 | #include <QFile> | ||||
24 | #include "problem.h" | 25 | #include "problem.h" | ||
25 | 26 | | |||
26 | class QFile; | | |||
27 | | ||||
28 | namespace KDevelop { | 27 | namespace KDevelop { | ||
29 | class TopDUContext; | 28 | class TopDUContext; | ||
30 | class DUContext; | 29 | class DUContext; | ||
Context not available. | |||||
33 | class IndexedDUContext; | 32 | class IndexedDUContext; | ||
34 | class DUChainBaseData; | 33 | class DUChainBaseData; | ||
35 | 34 | | |||
35 | #ifdef KDEV_TOPCONTEXTS_USE_FILES | ||||
36 | class TopDUContextFile; | ||||
37 | using TopDUContextStore = TopDUContextFile; | ||||
38 | #else | ||||
39 | class TopDUContextLMDB; | ||||
40 | using TopDUContextStore = TopDUContextLMDB; | ||||
41 | #endif | ||||
42 | | ||||
36 | ///This class contains dynamic data of a top-context, and also the repository that contains all the data within this top-context. | 43 | ///This class contains dynamic data of a top-context, and also the repository that contains all the data within this top-context. | ||
37 | class TopDUContextDynamicData | 44 | class TopDUContextDynamicData | ||
38 | { | 45 | { | ||
Context not available. | |||||
118 | uint position; | 125 | uint position; | ||
119 | }; | 126 | }; | ||
120 | 127 | | |||
128 | static QString basePath(); | ||||
129 | static QString pathForTopContext(const uint topContextIndex); | ||||
130 | | ||||
121 | private: | 131 | private: | ||
122 | bool hasChanged() const; | 132 | bool hasChanged() const; | ||
123 | 133 | | |||
Context not available. | |||||
153 | void deleteOnDisk(); | 163 | void deleteOnDisk(); | ||
154 | bool isItemForIndexLoaded(uint index) const; | 164 | bool isItemForIndexLoaded(uint index) const; | ||
155 | 165 | | |||
156 | void loadData(QFile* file) const; | 166 | void loadData(TopDUContextStore* file) const; | ||
157 | void writeData(QFile* file); | 167 | void writeData(TopDUContextStore* file); | ||
158 | 168 | | |||
159 | //May contain zero items if they were deleted | 169 | //May contain zero items if they were deleted | ||
160 | mutable QVector<Item> items; | 170 | mutable QVector<Item> items; | ||
Context not available. | |||||
174 | bool m_onDisk; | 184 | bool m_onDisk; | ||
175 | mutable bool m_dataLoaded; | 185 | mutable bool m_dataLoaded; | ||
176 | 186 | | |||
177 | mutable QFile* m_mappedFile; | 187 | mutable TopDUContextStore* m_mappedFile; | ||
178 | mutable uchar* m_mappedData; | 188 | mutable uchar* m_mappedData; | ||
179 | mutable size_t m_mappedDataSize; | 189 | mutable size_t m_mappedDataSize; | ||
180 | mutable bool m_itemRetrievalForbidden; | 190 | mutable bool m_itemRetrievalForbidden; | ||
Context not available. |