Changeset View
Changeset View
Standalone View
Standalone View
language/duchain/types/typesystemdata.h
Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Line(s) | 47 | public: | |||
---|---|---|---|---|---|
63 | /** | 63 | /** | ||
64 | * Internal setup for the data structure. | 64 | * Internal setup for the data structure. | ||
65 | * | 65 | * | ||
66 | * This must be called from actual class that belongs to this data(not parent classes), and the class must have the | 66 | * This must be called from actual class that belongs to this data(not parent classes), and the class must have the | ||
67 | * "Identity" enumerator with a unique identity. Do NOT call this in copy-constructors! | 67 | * "Identity" enumerator with a unique identity. Do NOT call this in copy-constructors! | ||
68 | */ | 68 | */ | ||
69 | template<class T> | 69 | template<class T> | ||
70 | void setTypeClassId() { | 70 | void setTypeClassId() { | ||
71 | static_assert(T::Identity < std::numeric_limits<decltype(typeClassId)>::max(), "TypeClass ID out of bounds"); | ||||
71 | typeClassId = T::Identity; | 72 | typeClassId = T::Identity; | ||
72 | } | 73 | } | ||
73 | 74 | | |||
74 | /// Remember which type this data was created for. \sa setTypeClassId() | 75 | /// Reference-count for this type within the repository. Not used for comparison or hashes. | ||
75 | uint typeClassId; | 76 | uint refCount; | ||
76 | 77 | | |||
77 | /// Type modifier flags | 78 | /// Type modifier flags | ||
78 | quint64 m_modifiers; | 79 | quint32 m_modifiers; | ||
mwolff: is this really safe? is it not up to language plugins to put data in here and maybe python or… | |||||
See above; I didn't see a place where any custom modifiers were used. Checked with ack / LXR. No uses of LanguageSpecificModifier (which would be required) at all. kfunk: See above; I didn't see a place where any custom modifiers were used. Checked with ack / LXR. | |||||
80 | | ||||
81 | /// Remember which type this data was created for. \sa setTypeClassId() | ||||
82 | quint16 typeClassId; | ||||
79 | 83 | | |||
80 | /// Remember whether this type is in a TypeRepository. Not used for comparison or hashes. | 84 | /// Remember whether this type is in a TypeRepository. Not used for comparison or hashes. | ||
81 | bool inRepository : 1; | 85 | bool inRepository : 1; | ||
82 | 86 | | |||
83 | /// Reference-count for this type within the repository. Not used for comparison or hashes. | | |||
84 | uint refCount; | | |||
85 | | ||||
86 | APPENDED_LISTS_STUB(AbstractTypeData) | 87 | APPENDED_LISTS_STUB(AbstractTypeData) | ||
87 | 88 | | |||
88 | /// Returns the pure data size of this class(not including anything dynamic). | 89 | /// Returns the pure data size of this class(not including anything dynamic). | ||
89 | uint classSize() const; | 90 | uint classSize() const; | ||
90 | 91 | | |||
91 | /// Returns the complete size of this item in memory, including derived class data and derived class appended list data | 92 | /// Returns the complete size of this item in memory, including derived class data and derived class appended list data | ||
92 | unsigned int itemSize() const; | 93 | unsigned int itemSize() const; | ||
93 | 94 | | |||
▲ Show 20 Lines • Show All 130 Lines • Show Last 20 Lines |
is this really safe? is it not up to language plugins to put data in here and maybe python or so using large modifiers?