Commit 95ea14ec authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Item classes for ItemRepository: expl. delete copy-assignment operator

Not used/expected by ItemRepository code, also often default operator
not sufficient
parent 6ffb49f0
......@@ -98,6 +98,8 @@ public:
freeAppendedLists();
}
CodeModelRepositoryItem& operator=(const CodeModelRepositoryItem& rhs) = delete;
unsigned int hash() const
{
//We only compare the declaration. This allows us implementing a map, although the item-repository
......
......@@ -47,6 +47,8 @@ public:
freeAppendedLists();
}
DefinitionsItem& operator=(const DefinitionsItem& rhs) = delete;
unsigned int hash() const
{
//We only compare the declaration. This allows us implementing a map, although the item-repository
......
......@@ -103,6 +103,8 @@ public:
{
}
EnvironmentInformationItem& operator=(const EnvironmentInformationItem& rhs) = delete;
unsigned int hash() const
{
return m_topContext;
......
......@@ -55,6 +55,8 @@ public:
templateIdentifiersList.free(const_cast<IndexedTypeIdentifier*>(templateIdentifiers()));
}
IdentifierPrivate& operator=(const IdentifierPrivate& rhs) = delete;
//Flags the stored hash-value invalid
void clearHash()
{
......@@ -211,6 +213,8 @@ public:
identifiersList.free(const_cast<IndexedIdentifier*>(identifiers()));
}
QualifiedIdentifierPrivate& operator=(const QualifiedIdentifierPrivate& rhs) = delete;
bool m_explicitlyGlobal : 1;
bool m_isExpression : 1;
mutable uint m_hash = 0;
......
......@@ -44,6 +44,8 @@ public:
freeAppendedLists();
}
ImportersItem& operator=(const ImportersItem& rhs) = delete;
unsigned int hash() const
{
//We only compare the declaration. This allows us implementing a map, although the item-repository
......
......@@ -75,6 +75,8 @@ public:
freeAppendedLists();
}
PersistentSymbolTableItem& operator=(const PersistentSymbolTableItem& rhs) = delete;
inline unsigned int hash() const
{
//We only compare the declaration. This allows us implementing a map, although the item-repository
......
......@@ -44,6 +44,8 @@ public:
freeAppendedLists();
}
UsesItem& operator=(const UsesItem& rhs) = delete;
unsigned int hash() const
{
//We only compare the declaration. This allows us implementing a map, although the item-repository
......
......@@ -44,6 +44,8 @@ struct FileModificationPair
{
}
FileModificationPair& operator=(const FileModificationPair& rhs) = delete;
unsigned int hash() const
{
return ((file.hash() + revision.modificationTime) * 17 + revision.revision) * 73;
......
......@@ -30,6 +30,8 @@ struct IndexedStringData
unsigned short length;
uint refCount;
IndexedStringData& operator=(const IndexedStringData& rhs) = delete;
uint itemSize() const
{
return sizeof(IndexedStringData) + length;
......
......@@ -155,6 +155,8 @@ struct ReferenceCountItem
{
}
ReferenceCountItem& operator=(const ReferenceCountItem& rhs) = delete;
//Every item has to implement this function, and return a valid hash.
//Must be exactly the same hash value as ReferenceCountItemRequest::hash() has returned while creating the item.
unsigned int hash() const
......
......@@ -30,6 +30,9 @@ using namespace KDevelop;
struct StringData
{
unsigned short length;
StringData& operator=(const StringData& rhs) = delete;
unsigned int itemSize() const
{
return sizeof(StringData) + length;
......
......@@ -34,6 +34,9 @@ using namespace KDevelop;
struct TestData
{
uint length;
TestData& operator=(const TestData& rhs) = delete;
uint itemSize() const
{
return sizeof(TestData) + length;
......
......@@ -13,6 +13,9 @@ struct TestItem
, m_dataSize(dataSize)
{
}
TestItem& operator=(const TestItem& rhs) = delete;
//Every item has to implement this function, and return a valid hash.
//Must be exactly the same hash value as ExampleItemRequest::hash() has returned while creating the item.
unsigned int hash() const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment