Changeset View
Changeset View
Standalone View
Standalone View
language/duchain/duchainbase.h
Show First 20 Lines • Show All 70 Lines • ▼ Show 20 Line(s) | 61 | public: | |||
---|---|---|---|---|---|
71 | ~DUChainBaseData() { | 71 | ~DUChainBaseData() { | ||
72 | freeAppendedLists(); | 72 | freeAppendedLists(); | ||
73 | } | 73 | } | ||
74 | 74 | | |||
75 | RangeInRevision m_range; | 75 | RangeInRevision m_range; | ||
76 | 76 | | |||
77 | APPENDED_LISTS_STUB(DUChainBaseData) | 77 | APPENDED_LISTS_STUB(DUChainBaseData) | ||
78 | 78 | | |||
79 | uint classId; | 79 | quint16 classId; | ||
80 | 80 | | |||
81 | bool isDynamic() const { | 81 | bool isDynamic() const { | ||
82 | return m_dynamic; | 82 | return m_dynamic; | ||
83 | } | 83 | } | ||
84 | 84 | | |||
85 | /** | 85 | /** | ||
86 | * Internal setup for the data structure. | 86 | * Internal setup for the data structure. | ||
87 | * | 87 | * | ||
88 | * This must be called from actual class that belongs to this data(not parent classes), and the class must have the | 88 | * This must be called from actual class that belongs to this data(not parent classes), and the class must have the | ||
89 | * "Identity" enumerator with a unique identity. Do NOT call this in copy-constructors! | 89 | * "Identity" enumerator with a unique identity. Do NOT call this in copy-constructors! | ||
90 | */ | 90 | */ | ||
91 | template<class T> | 91 | template<class T> | ||
92 | void setClassId(T*) { | 92 | void setClassId(T*) { | ||
93 | static_assert(T::Identity < std::numeric_limits<decltype(classId)>::max(), "Class ID out of bounds"); | ||||
93 | classId = T::Identity; | 94 | classId = T::Identity; | ||
94 | } | 95 | } | ||
95 | 96 | | |||
96 | uint classSize() const; | 97 | uint classSize() const; | ||
97 | 98 | | |||
98 | ///This is called whenever the data-object is being deleted memory-wise, but not semantically(Which means it stays on disk) | 99 | ///This is called whenever the data-object is being deleted memory-wise, but not semantically(Which means it stays on disk) | ||
99 | ///Implementations of parent-classes must always be called | 100 | ///Implementations of parent-classes must always be called | ||
100 | void freeDynamicData() { | 101 | void freeDynamicData() { | ||
▲ Show 20 Lines • Show All 120 Lines • Show Last 20 Lines |