Commit 2dea8fe2 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

duchain type classes: expl. delete copy-assignment operator

parent 70dccaf7
......@@ -125,6 +125,8 @@ public:
/// Destructor.
virtual ~AbstractType ();
AbstractType& operator=(const AbstractType& rhs) = delete;
/**
* Access the type modifiers
*
......
......@@ -41,6 +41,8 @@ public:
/// Destructor
~ArrayType() override;
ArrayType& operator=(const ArrayType& rhs) = delete;
AbstractType* clone() const override;
bool equals(const AbstractType* rhs) const override;
......
......@@ -44,6 +44,8 @@ public:
explicit ConstantIntegralType(uint type = TypeNone);
ConstantIntegralType& operator=(const ConstantIntegralType& rhs) = delete;
using Ptr = TypePtr<ConstantIntegralType>;
/**The types and modifiers are not changed!
......
......@@ -43,6 +43,8 @@ public:
: KDevelop::StructureTypeData(rhs)
, m_contentType() { }
ListTypeData& operator=(const ListTypeData& rhs) = delete;
IndexedType m_contentType;
};
......@@ -86,6 +88,8 @@ public:
ListType(const ListType& rhs);
explicit ListType(StructureTypeData& data);
ListType& operator=(const ListType& rhs) = delete;
/**
* @brief Adds @p typeToAdd to the content type of this list.
*
......@@ -158,6 +162,8 @@ public:
: ListTypeData(rhs)
, m_keyType() { }
MapTypeData& operator=(const ListTypeData& rhs) = delete;
IndexedType m_keyType;
};
......@@ -177,6 +183,8 @@ public:
MapType(const MapType& rhs);
explicit MapType(ListTypeData& data);
MapType& operator=(const MapType& rhs) = delete;
/**
* @brief Add @p typeToAdd to this map's key type.
* Behaves like addContentType, except that it modifies the key type instead.
......
......@@ -56,6 +56,8 @@ public:
/// Destructor
~DelayedType() override;
DelayedType& operator=(const DelayedType& rhs) = delete;
/**
* Access the type identifier which this type represents.
*
......
......@@ -40,6 +40,9 @@ public:
EnumerationType(const EnumerationType& rhs);
explicit EnumerationType(EnumerationTypeData& data);
EnumerationType& operator=(const EnumerationType& rhs) = delete;
using Ptr = TypePtr<EnumerationType>;
uint hash() const override;
......
......@@ -41,6 +41,8 @@ public:
EnumeratorType();
EnumeratorType& operator=(const EnumeratorType& rhs) = delete;
using Ptr = TypePtr<EnumeratorType>;
bool equals(const KDevelop::AbstractType* rhs) const override;
......
......@@ -55,6 +55,8 @@ public:
/// Destructor
~FunctionType() override;
FunctionType& operator=(const FunctionType& rhs) = delete;
/**
* Retrieve the return type of the function.
*
......
......@@ -73,6 +73,8 @@ public:
/// Destructor
~IntegralType() override;
IntegralType& operator=(const IntegralType& rhs) = delete;
/**
* Access the integral type
*
......
......@@ -47,6 +47,8 @@ public:
/// Destructor
~PointerType() override;
PointerType& operator=(const PointerType& rhs) = delete;
/**
* Sets the base type of the pointer, ie. what type of data the pointer points to.
*
......
......@@ -47,6 +47,8 @@ public:
/// Destructor
~ReferenceType() override;
ReferenceType& operator=(const ReferenceType& rhs) = delete;
/**
* Retrieve the referenced type, ie. what type of data this type references.
*
......
......@@ -50,6 +50,8 @@ public:
/// Destructor
~StructureType() override;
StructureType& operator=(const StructureType& rhs) = delete;
AbstractType* clone() const override;
bool equals(const AbstractType* rhs) const override;
......
......@@ -47,6 +47,8 @@ public:
{
}
TypeAliasType& operator=(const TypeAliasType& rhs) = delete;
KDevelop::AbstractType::Ptr type() const;
void setType(const KDevelop::AbstractType::Ptr& type);
......
......@@ -111,6 +111,7 @@ public:
IntegralTypeData();
/// Copy constructor. \param rhs data to copy
IntegralTypeData(const IntegralTypeData& rhs);
IntegralTypeData& operator=(const IntegralTypeData& rhs) = delete;
/// Data type
uint m_dataType = IntegralType::TypeNone;
};
......@@ -124,6 +125,7 @@ public:
PointerTypeData();
/// Copy constructor. \param rhs data to copy
PointerTypeData(const PointerTypeData& rhs);
PointerTypeData& operator=(const PointerTypeData& rhs) = delete;
/// Type of data at which the pointer points
IndexedType m_baseType;
};
......@@ -137,6 +139,7 @@ public:
ReferenceTypeData();
/// Copy constructor. \param rhs data to copy
ReferenceTypeData(const ReferenceTypeData& rhs);
ReferenceTypeData& operator=(const ReferenceTypeData& rhs) = delete;
/// Type of data which is referenced
IndexedType m_baseType;
/// True if this is an rvalue-reference, false for lvalue-references
......@@ -189,6 +192,7 @@ public:
/// Copy constructor. \param rhs data to copy
StructureTypeData(const StructureTypeData& rhs);
/// Whether the type is closed yet
StructureTypeData& operator=(const StructureTypeData& rhs) = delete;
};
/// Private data structure for ArrayType
......@@ -200,6 +204,7 @@ public:
ArrayTypeData();
/// Copy constructor. \param rhs data to copy
ArrayTypeData(const ArrayTypeData& rhs);
ArrayTypeData& operator=(const ArrayTypeData& rhs) = delete;
/// Dimension of the array
int m_dimension = 0;
/// Element type of the array
......@@ -215,6 +220,7 @@ public:
DelayedTypeData();
/// Copy constructor. \param rhs data to copy
DelayedTypeData(const DelayedTypeData& rhs);
DelayedTypeData& operator=(const DelayedTypeData& rhs) = delete;
/// Identifier of the delayed type
IndexedTypeIdentifier m_identifier;
/// Type of delay in resolving the type
......
......@@ -46,6 +46,8 @@ struct KDEVPLATFORMLANGUAGE_EXPORT UnsureTypeData
copyListsFrom(rhs);
}
UnsureTypeData& operator=(const UnsureTypeData& rhs) = delete;
START_APPENDED_LISTS_BASE(UnsureTypeData, AbstractTypeData)
APPENDED_LIST_FIRST(UnsureTypeData, IndexedType, m_types)
END_APPENDED_LISTS(UnsureTypeData, m_types)
......@@ -61,6 +63,8 @@ public:
UnsureType();
explicit UnsureType(UnsureTypeData& data);
UnsureType& operator=(const UnsureType& rhs) = delete;
KDevelop::AbstractType* clone() const override;
QString toString() const override;
bool equals(const KDevelop::AbstractType* rhs) const override;
......
......@@ -30,6 +30,7 @@ struct KDEVCMAKECOMMON_EXPORT TargetTypeData : public KDevelop::AbstractTypeData
~TargetTypeData() {}
TargetTypeData(const TargetTypeData& rhs) : AbstractTypeData(rhs) {}
TargetTypeData& operator=(const TargetTypeData& rhs) = delete;
};
class KDEVCMAKECOMMON_EXPORT TargetType : public KDevelop::AbstractType
......@@ -38,6 +39,7 @@ class KDEVCMAKECOMMON_EXPORT TargetType : public KDevelop::AbstractType
TargetType();
TargetType(const TargetType& rhs);
explicit TargetType(KDevelop::AbstractTypeData& dd);
TargetType& operator=(const TargetType& rhs) = delete;
void accept0(KDevelop::TypeVisitor* v) const override;
AbstractType* clone() const override;
......
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