From b6cae3bfdfe07b1bba155e235b0f20f010e82f16 Mon Sep 17 00:00:00 2001 From: berniev Date: Mon, 1 Aug 2022 03:07:32 +1000 Subject: [PATCH] App: Modernise ctors dtors defs etc --- src/App/Annotation.cpp | 8 +- src/App/Annotation.h | 8 +- src/App/Application.cpp | 4 +- src/App/ColorModel.h | 2 +- src/App/ComplexGeoData.cpp | 36 ++- src/App/ComplexGeoData.h | 4 +- src/App/Document.cpp | 3 +- src/App/Document.h | 10 +- src/App/DocumentObjectExtension.cpp | 5 +- src/App/DocumentObjectExtension.h | 4 +- src/App/DocumentObjectFileIncluded.cpp | 4 +- src/App/DocumentObjectFileIncluded.h | 4 +- src/App/DocumentObjectGroup.cpp | 4 +- src/App/DocumentObjectGroup.h | 6 +- src/App/DocumentObserver.cpp | 36 +-- src/App/DocumentObserver.h | 15 +- src/App/DocumentObserverPython.cpp | 4 +- src/App/DynamicProperty.cpp | 4 +- src/App/Enumeration.cpp | 12 +- src/App/Enumeration.h | 2 +- src/App/Expression.cpp | 34 +-- src/App/Expression.h | 14 +- src/App/ExpressionParser.h | 146 +++++----- src/App/ExtensionContainer.cpp | 4 +- src/App/ExtensionContainer.h | 28 +- src/App/ExtensionPython.h | 3 +- src/App/FeatureCustom.h | 6 +- src/App/FeaturePython.h | 36 +-- src/App/FeatureTest.cpp | 5 +- src/App/FeatureTest.h | 12 +- src/App/GeoFeature.cpp | 4 +- src/App/GeoFeature.h | 4 +- src/App/GeoFeatureGroupExtension.cpp | 4 +- src/App/GeoFeatureGroupExtension.h | 14 +- src/App/GroupExtension.cpp | 4 +- src/App/GroupExtension.h | 18 +- src/App/InventorObject.cpp | 4 +- src/App/InventorObject.h | 10 +- src/App/MaterialObject.h | 4 +- src/App/MeasureDistance.cpp | 4 +- src/App/MeasureDistance.h | 8 +- src/App/MergeDocuments.cpp | 6 +- src/App/MergeDocuments.h | 12 +- src/App/Metadata.cpp | 10 +- src/App/ObjectIdentifier.h | 2 +- src/App/Origin.cpp | 3 +- src/App/Origin.h | 16 +- src/App/OriginFeature.cpp | 3 +- src/App/OriginFeature.h | 6 +- src/App/OriginGroupExtension.cpp | 3 +- src/App/OriginGroupExtension.h | 18 +- src/App/Part.cpp | 4 +- src/App/Part.h | 8 +- src/App/Path.cpp | 8 +- src/App/Placement.cpp | 9 +- src/App/Placement.h | 4 +- src/App/Property.cpp | 5 +- src/App/Property.h | 14 +- src/App/PropertyContainer.cpp | 5 +- src/App/PropertyContainer.h | 8 +- src/App/PropertyExpressionEngine.cpp | 4 +- src/App/PropertyExpressionEngine.h | 28 +- src/App/PropertyFile.cpp | 10 +- src/App/PropertyFile.h | 30 +- src/App/PropertyGeo.cpp | 120 ++------ src/App/PropertyGeo.h | 154 +++++----- src/App/PropertyLinks.cpp | 34 +-- src/App/PropertyLinks.h | 254 ++++++++-------- src/App/PropertyPythonObject.cpp | 4 +- src/App/PropertyPythonObject.h | 20 +- src/App/PropertyStandard.cpp | 169 +++-------- src/App/PropertyStandard.h | 386 ++++++++++++------------- src/App/PropertyUnits.h | 50 ++-- src/App/TextDocument.h | 6 +- src/App/TransactionalObject.cpp | 8 +- src/App/TransactionalObject.h | 2 +- src/App/Transactions.cpp | 8 +- src/App/Transactions.h | 30 +- src/App/VRMLObject.cpp | 4 +- src/App/VRMLObject.h | 20 +- 80 files changed, 866 insertions(+), 1160 deletions(-) diff --git a/src/App/Annotation.cpp b/src/App/Annotation.cpp index d3101d5f5d..b0b5939349 100644 --- a/src/App/Annotation.cpp +++ b/src/App/Annotation.cpp @@ -36,9 +36,7 @@ Annotation::Annotation() ADD_PROPERTY(Position,(Base::Vector3d())); } -Annotation::~Annotation() -{ -} +Annotation::~Annotation() = default; // -------------------------------------------------- @@ -52,6 +50,4 @@ AnnotationLabel::AnnotationLabel() ADD_PROPERTY_TYPE(TextPosition,(Base::Vector3d()),"Label",Prop_Output,"Text position"); } -AnnotationLabel::~AnnotationLabel() -{ -} +AnnotationLabel::~AnnotationLabel() = default; diff --git a/src/App/Annotation.h b/src/App/Annotation.h index ab1da86fb8..475e71a046 100644 --- a/src/App/Annotation.h +++ b/src/App/Annotation.h @@ -39,13 +39,13 @@ class AppExport Annotation : public DocumentObject public: /// Constructor Annotation(); - virtual ~Annotation(); + ~Annotation() override; App::PropertyStringList LabelText; App::PropertyVector Position; /// returns the type name of the ViewProvider - const char* getViewProviderName() const { + const char* getViewProviderName() const override { return "Gui::ViewProviderAnnotation"; } }; @@ -57,14 +57,14 @@ class AppExport AnnotationLabel : public DocumentObject public: /// Constructor AnnotationLabel(); - virtual ~AnnotationLabel(); + ~AnnotationLabel() override; App::PropertyStringList LabelText; App::PropertyVector BasePosition; App::PropertyVector TextPosition; /// returns the type name of the ViewProvider - const char* getViewProviderName() const { + const char* getViewProviderName() const override { return "Gui::ViewProviderAnnotationLabel"; } }; diff --git a/src/App/Application.cpp b/src/App/Application.cpp index 0f6f269baa..b6b3041393 100644 --- a/src/App/Application.cpp +++ b/src/App/Application.cpp @@ -240,9 +240,7 @@ Application::Application(std::map &mConfig) setupPythonTypes(); } -Application::~Application() -{ -} +Application::~Application() = default; void Application::setupPythonTypes() { diff --git a/src/App/ColorModel.h b/src/App/ColorModel.h index 98badd2271..a9b4b5d292 100644 --- a/src/App/ColorModel.h +++ b/src/App/ColorModel.h @@ -442,7 +442,7 @@ class AppExport ColorLegend public: ColorLegend (); ColorLegend (const ColorLegend &rclCL); - virtual ~ColorLegend () {} + virtual ~ColorLegend () = default; ColorLegend& operator = (const ColorLegend &rclCL); bool operator == (const ColorLegend &rclCL) const; diff --git a/src/App/ComplexGeoData.cpp b/src/App/ComplexGeoData.cpp index 115458272b..151216727a 100644 --- a/src/App/ComplexGeoData.cpp +++ b/src/App/ComplexGeoData.cpp @@ -28,7 +28,7 @@ #endif #include -#include +#include #include "ComplexGeoData.h" #include @@ -49,22 +49,20 @@ ComplexGeoData::ComplexGeoData() { } -ComplexGeoData::~ComplexGeoData() -{ -} +ComplexGeoData::~ComplexGeoData() = default; Data::Segment* ComplexGeoData::getSubElementByName(const char* name) const { - int index = 0; - std::string element; - boost::regex ex("^([^0-9]*)([0-9]*)$"); - boost::cmatch what; - - if (boost::regex_match(name, what, ex)) { - element = what[1].str(); - index = std::atoi(what[2].str().c_str()); - } - + int index = 0; + std::string element; + boost::regex ex("^([^0-9]*)([0-9]*)$"); + boost::cmatch what; + + if (boost::regex_match(name, what, ex)) { + element = what[1].str(); + index = std::atoi(what[2].str().c_str()); + } + return getSubElement(element.c_str(), static_cast(index)); } @@ -175,10 +173,10 @@ const char *ComplexGeoData::isMappedElement(const char *name) { } std::string ComplexGeoData::newElementName(const char *name) { - if(!name) + if(!name) return std::string(); const char *dot = strrchr(name,'.'); - if(!dot || dot==name) + if(!dot || dot==name) return name; const char *c = dot-1; for(;c!=name;--c) { @@ -193,10 +191,10 @@ std::string ComplexGeoData::newElementName(const char *name) { } std::string ComplexGeoData::oldElementName(const char *name) { - if(!name) + if(!name) return std::string(); const char *dot = strrchr(name,'.'); - if(!dot || dot==name) + if(!dot || dot==name) return name; const char *c = dot-1; for(;c!=name;--c) { @@ -211,7 +209,7 @@ std::string ComplexGeoData::oldElementName(const char *name) { } std::string ComplexGeoData::noElementName(const char *name) { - if(!name) + if(!name) return std::string(); auto element = findElementName(name); if(element) diff --git a/src/App/ComplexGeoData.h b/src/App/ComplexGeoData.h index 81ae1e347e..35ab710562 100644 --- a/src/App/ComplexGeoData.h +++ b/src/App/ComplexGeoData.h @@ -53,7 +53,7 @@ class AppExport Segment: public Base::BaseClass TYPESYSTEM_HEADER(); public: - virtual ~Segment(){} + ~Segment() override = default; virtual std::string getName() const=0; }; @@ -75,7 +75,7 @@ public: /// Constructor ComplexGeoData(); /// Destructor - virtual ~ComplexGeoData(); + ~ComplexGeoData() override; /** @name Subelement management */ //@{ diff --git a/src/App/Document.cpp b/src/App/Document.cpp index e2ab951fc1..5fc3ebf4f4 100644 --- a/src/App/Document.cpp +++ b/src/App/Document.cpp @@ -2328,8 +2328,7 @@ public: useFCBakExtension = false; saveBackupDateFormat = "%Y%m%d-%H%M%S"; } - ~BackupPolicy() { - } + ~BackupPolicy() = default; void setPolicy(Policy p) { policy = p; } diff --git a/src/App/Document.h b/src/App/Document.h index 21bb8613f6..22c9ccdef8 100644 --- a/src/App/Document.h +++ b/src/App/Document.h @@ -230,8 +230,8 @@ public: const char* getFileName() const; //@} - virtual void Save (Base::Writer &writer) const override; - virtual void Restore(Base::XMLReader &reader) override; + void Save (Base::Writer &writer) const override; + void Restore(Base::XMLReader &reader) override; /// returns the complete document memory consumption, including all managed DocObjects and Undo Redo. unsigned int getMemSize () const override; @@ -491,9 +491,9 @@ public: /// Function called to signal that an object identifier has been renamed void renameObjectIdentifiers(const std::map & paths, const std::function &selector = [](const App::DocumentObject *) { return true; }); - virtual PyObject *getPyObject() override; + PyObject *getPyObject() override; - virtual std::string getFullName() const override; + std::string getFullName() const override; /// Indicate if there is any document restoring/importing static bool isAnyRestoring(); @@ -506,7 +506,7 @@ public: friend class TransactionDocumentObject; /// Destruction - virtual ~Document(); + ~Document() override; protected: /// Construction diff --git a/src/App/DocumentObjectExtension.cpp b/src/App/DocumentObjectExtension.cpp index 9492e3ff5c..7072b6baea 100644 --- a/src/App/DocumentObjectExtension.cpp +++ b/src/App/DocumentObjectExtension.cpp @@ -37,10 +37,7 @@ DocumentObjectExtension::DocumentObjectExtension() initExtensionType(App::DocumentObjectExtension::getExtensionClassTypeId()); } -DocumentObjectExtension::~DocumentObjectExtension() -{ - -} +DocumentObjectExtension::~DocumentObjectExtension() = default; short int DocumentObjectExtension::extensionMustExecute() { diff --git a/src/App/DocumentObjectExtension.h b/src/App/DocumentObjectExtension.h index 8b7ba82a39..a27b6f680d 100644 --- a/src/App/DocumentObjectExtension.h +++ b/src/App/DocumentObjectExtension.h @@ -47,7 +47,7 @@ class AppExport DocumentObjectExtension : public App::Extension public: DocumentObjectExtension (); - virtual ~DocumentObjectExtension (); + ~DocumentObjectExtension () override; App::DocumentObject* getExtendedObject(); const App::DocumentObject* getExtendedObject() const; @@ -66,7 +66,7 @@ public: /// get called when object is going to be removed from the document virtual void onExtendedUnsetupObject(); - virtual PyObject* getExtensionPyObject() override; + PyObject* getExtensionPyObject() override; /// returns the type name of the ViewProviderExtension which is automatically attached /// to the viewprovider object when it is initiated diff --git a/src/App/DocumentObjectFileIncluded.cpp b/src/App/DocumentObjectFileIncluded.cpp index b8bbae91c4..e3bbafe4ae 100644 --- a/src/App/DocumentObjectFileIncluded.cpp +++ b/src/App/DocumentObjectFileIncluded.cpp @@ -35,7 +35,5 @@ DocumentObjectFileIncluded::DocumentObjectFileIncluded() ADD_PROPERTY_TYPE(File,(nullptr),"",(App::PropertyType)(Prop_None),"File to include into Project File"); } -DocumentObjectFileIncluded::~DocumentObjectFileIncluded() -{ -} +DocumentObjectFileIncluded::~DocumentObjectFileIncluded() = default; diff --git a/src/App/DocumentObjectFileIncluded.h b/src/App/DocumentObjectFileIncluded.h index 0dd4843729..88cb807d31 100644 --- a/src/App/DocumentObjectFileIncluded.h +++ b/src/App/DocumentObjectFileIncluded.h @@ -38,11 +38,11 @@ class AppExport DocumentObjectFileIncluded : public DocumentObject public: /// Constructor DocumentObjectFileIncluded(); - virtual ~DocumentObjectFileIncluded(); + ~DocumentObjectFileIncluded() override; /// returns the type name of the ViewProvider - virtual const char* getViewProviderName() const { + const char* getViewProviderName() const override { return "Gui::ViewProviderDocumentObject"; } diff --git a/src/App/DocumentObjectGroup.cpp b/src/App/DocumentObjectGroup.cpp index 4b4d9f0e73..c4fdd690f2 100644 --- a/src/App/DocumentObjectGroup.cpp +++ b/src/App/DocumentObjectGroup.cpp @@ -37,9 +37,7 @@ DocumentObjectGroup::DocumentObjectGroup(): DocumentObject(), GroupExtension() { _GroupTouched.setStatus(App::Property::Output,true); } -DocumentObjectGroup::~DocumentObjectGroup() { - -} +DocumentObjectGroup::~DocumentObjectGroup() = default; PyObject *DocumentObjectGroup::getPyObject() { diff --git a/src/App/DocumentObjectGroup.h b/src/App/DocumentObjectGroup.h index f0fa9301d3..d40b027cd4 100644 --- a/src/App/DocumentObjectGroup.h +++ b/src/App/DocumentObjectGroup.h @@ -39,14 +39,14 @@ class AppExport DocumentObjectGroup : public DocumentObject, public GroupExtensi public: /// Constructor DocumentObjectGroup(); - virtual ~DocumentObjectGroup(); + ~DocumentObjectGroup() override; /// returns the type name of the ViewProvider - virtual const char* getViewProviderName() const override { + const char* getViewProviderName() const override { return "Gui::ViewProviderDocumentObjectGroup"; } - virtual PyObject *getPyObject() override; + PyObject *getPyObject() override; }; typedef App::FeaturePythonT DocumentObjectGroupPython; diff --git a/src/App/DocumentObserver.cpp b/src/App/DocumentObserver.cpp index dfc4eeac59..c93fc5cd76 100644 --- a/src/App/DocumentObserver.cpp +++ b/src/App/DocumentObserver.cpp @@ -35,9 +35,7 @@ using namespace App; namespace sp = std::placeholders; -DocumentT::DocumentT() -{ -} +DocumentT::DocumentT() = default; DocumentT::DocumentT(Document* doc) { @@ -54,9 +52,7 @@ DocumentT::DocumentT(const DocumentT& doc) document = doc.document; } -DocumentT::~DocumentT() -{ -} +DocumentT::~DocumentT() = default; void DocumentT::operator=(const DocumentT& doc) { @@ -94,9 +90,7 @@ std::string DocumentT::getDocumentPython() const // ----------------------------------------------------------------------------- -DocumentObjectT::DocumentObjectT() -{ -} +DocumentObjectT::DocumentObjectT() = default; DocumentObjectT::DocumentObjectT(const DocumentObjectT &other) { @@ -133,9 +127,7 @@ DocumentObjectT::DocumentObjectT(const char *docName, const char *objName) object = objName; } -DocumentObjectT::~DocumentObjectT() -{ -} +DocumentObjectT::~DocumentObjectT() = default; DocumentObjectT &DocumentObjectT::operator=(const DocumentObjectT& obj) { @@ -265,8 +257,7 @@ Property *DocumentObjectT::getProperty() const { // ----------------------------------------------------------------------------- -SubObjectT::SubObjectT() -{} +SubObjectT::SubObjectT() = default; SubObjectT::SubObjectT(const SubObjectT &other) :DocumentObjectT(other), subname(other.subname) @@ -579,9 +570,7 @@ DocumentWeakPtrT::DocumentWeakPtrT(App::Document* doc) noexcept { } -DocumentWeakPtrT::~DocumentWeakPtrT() -{ -} +DocumentWeakPtrT::~DocumentWeakPtrT() = default; void DocumentWeakPtrT::reset() noexcept { @@ -664,10 +653,7 @@ DocumentObjectWeakPtrT::DocumentObjectWeakPtrT(App::DocumentObject* obj) { } -DocumentObjectWeakPtrT::~DocumentObjectWeakPtrT() -{ - -} +DocumentObjectWeakPtrT::~DocumentObjectWeakPtrT() = default; App::DocumentObject* DocumentObjectWeakPtrT::_get() const noexcept { @@ -809,13 +795,9 @@ void DocumentObserver::slotRecomputedDocument(const Document& /*doc*/) // ----------------------------------------------------------------------------- -DocumentObjectObserver::DocumentObjectObserver() -{ -} +DocumentObjectObserver::DocumentObjectObserver() = default; -DocumentObjectObserver::~DocumentObjectObserver() -{ -} +DocumentObjectObserver::~DocumentObjectObserver() = default; DocumentObjectObserver::const_iterator DocumentObjectObserver::begin() const { diff --git a/src/App/DocumentObserver.h b/src/App/DocumentObserver.h index 2ac41a868f..5d4b580584 100644 --- a/src/App/DocumentObserver.h +++ b/src/App/DocumentObserver.h @@ -385,8 +385,7 @@ class WeakPtrT public: WeakPtrT(T* t) : ptr(t) { } - ~WeakPtrT() { - } + ~WeakPtrT() = default; /*! * \brief reset @@ -527,7 +526,7 @@ public: /// Constructor DocumentObjectObserver(); - virtual ~DocumentObjectObserver(); + ~DocumentObjectObserver() override; const_iterator begin() const; const_iterator end() const; @@ -536,15 +535,15 @@ public: private: /** Checks if a new document was created */ - virtual void slotCreatedDocument(const App::Document& Doc); + void slotCreatedDocument(const App::Document& Doc) override; /** Checks if the given document is about to be closed */ - virtual void slotDeletedDocument(const App::Document& Doc); + void slotDeletedDocument(const App::Document& Doc) override; /** Checks if a new object was added. */ - virtual void slotCreatedObject(const App::DocumentObject& Obj); + void slotCreatedObject(const App::DocumentObject& Obj) override; /** Checks if the given object is about to be removed. */ - virtual void slotDeletedObject(const App::DocumentObject& Obj); + void slotDeletedObject(const App::DocumentObject& Obj) override; /** The property of an observed object has changed */ - virtual void slotChangedObject(const App::DocumentObject& Obj, const App::Property& Prop); + void slotChangedObject(const App::DocumentObject& Obj, const App::Property& Prop) override; /** This method gets called when all observed objects are deleted or the whole document is deleted. * This method can be re-implemented to perform an extra step like closing a dialog that observes * a document. diff --git a/src/App/DocumentObserverPython.cpp b/src/App/DocumentObserverPython.cpp index bc8a01a51a..d13a29ceee 100644 --- a/src/App/DocumentObserverPython.cpp +++ b/src/App/DocumentObserverPython.cpp @@ -114,9 +114,7 @@ DocumentObserverPython::DocumentObserverPython(const Py::Object& obj) : inst(obj FC_PY_ELEMENT_ARG2(AddedDynamicExtension, AddedDynamicExtension) } -DocumentObserverPython::~DocumentObserverPython() -{ -} +DocumentObserverPython::~DocumentObserverPython() = default; void DocumentObserverPython::slotCreatedDocument(const App::Document& Doc) { diff --git a/src/App/DynamicProperty.cpp b/src/App/DynamicProperty.cpp index 821d09c873..6c11e0ad2d 100644 --- a/src/App/DynamicProperty.cpp +++ b/src/App/DynamicProperty.cpp @@ -39,9 +39,7 @@ FC_LOG_LEVEL_INIT("Property",true,true) using namespace App; -DynamicProperty::DynamicProperty() -{ -} +DynamicProperty::DynamicProperty() = default; DynamicProperty::~DynamicProperty() { diff --git a/src/App/Enumeration.cpp b/src/App/Enumeration.cpp index e0dfec6d1d..8a31b29ca1 100644 --- a/src/App/Enumeration.cpp +++ b/src/App/Enumeration.cpp @@ -36,13 +36,13 @@ namespace { struct StringCopy : public Enumeration::Object { StringCopy(const char* str) : d(str) { } - const char* data() const { + const char* data() const override { return d.data(); } - bool isEqual(const char* str) const { + bool isEqual(const char* str) const override { return d == str; } - bool isCustom() const { + bool isCustom() const override { return true; } @@ -53,13 +53,13 @@ private: struct StringView : public Enumeration::Object { StringView(const char* str) : d(str) { } - const char* data() const { + const char* data() const override { return d.data(); } - bool isEqual(const char* str) const { + bool isEqual(const char* str) const override { return d == str; } - bool isCustom() const { + bool isCustom() const override { return false; } diff --git a/src/App/Enumeration.h b/src/App/Enumeration.h index 6f9912c15e..1256e2719b 100644 --- a/src/App/Enumeration.h +++ b/src/App/Enumeration.h @@ -54,7 +54,7 @@ namespace App public: class Object { public: - virtual ~Object() {} + virtual ~Object() = default; virtual const char* data() const = 0; virtual bool isEqual(const char*) const = 0; virtual bool isCustom() const = 0; diff --git a/src/App/Expression.cpp b/src/App/Expression.cpp index 83d5dc014e..4fbc8068b7 100644 --- a/src/App/Expression.cpp +++ b/src/App/Expression.cpp @@ -944,7 +944,7 @@ public: :deps(deps) {} - virtual void visit(Expression &e) { + void visit(Expression &e) override { this->getIdentifiers(e,deps); } @@ -968,7 +968,7 @@ public: :inList(inList),res(false) {} - virtual void visit(Expression &e) { + void visit(Expression &e) override { if(this->adjustLinks(e,inList)) res = true; } @@ -989,7 +989,7 @@ public: :subNameMap(subNameMap) {} - virtual void visit(Expression &e) { + void visit(Expression &e) override { this->importSubNames(e,subNameMap); } @@ -1033,7 +1033,7 @@ public: :obj(obj),ref(ref),newLabel(newLabel) {} - virtual void visit(Expression &e) { + void visit(Expression &e) override { this->updateLabelReference(e,obj,ref,newLabel); } @@ -1070,7 +1070,7 @@ public: { } - void visit(Expression &e) { + void visit(Expression &e) override { if(collect) this->collectReplacement(e,paths,parent,oldObj,newObj); else @@ -1821,7 +1821,7 @@ bool FunctionExpression::isTouched() const class Collector { public: Collector() : first(true) { } - virtual ~Collector() {} + virtual ~Collector() = default; virtual void collect(Quantity value) { if (first) q.setUnit(value.getUnit()); @@ -1838,7 +1838,7 @@ class SumCollector : public Collector { public: SumCollector() : Collector() { } - void collect(Quantity value) { + void collect(Quantity value) override { Collector::collect(value); q += value; first = false; @@ -1850,14 +1850,14 @@ class AverageCollector : public Collector { public: AverageCollector() : Collector(), n(0) { } - void collect(Quantity value) { + void collect(Quantity value) override { Collector::collect(value); q += value; ++n; first = false; } - virtual Quantity getQuantity() const { return q/(double)n; } + Quantity getQuantity() const override { return q/(double)n; } private: unsigned int n; @@ -1867,7 +1867,7 @@ class StdDevCollector : public Collector { public: StdDevCollector() : Collector(), n(0) { } - void collect(Quantity value) { + void collect(Quantity value) override { Collector::collect(value); if (first) { M2 = Quantity(0, value.getUnit() * value.getUnit()); @@ -1882,7 +1882,7 @@ public: first = false; } - virtual Quantity getQuantity() const { + Quantity getQuantity() const override { if (n < 2) throw ExpressionError("Invalid number of entries: at least two required."); else @@ -1899,13 +1899,13 @@ class CountCollector : public Collector { public: CountCollector() : Collector(), n(0) { } - void collect(Quantity value) { + void collect(Quantity value) override { Collector::collect(value); ++n; first = false; } - virtual Quantity getQuantity() const { return Quantity(n); } + Quantity getQuantity() const override { return Quantity(n); } private: unsigned int n; @@ -1915,7 +1915,7 @@ class MinCollector : public Collector { public: MinCollector() : Collector() { } - void collect(Quantity value) { + void collect(Quantity value) override { Collector::collect(value); if (first || value < q) q = value; @@ -1927,7 +1927,7 @@ class MaxCollector : public Collector { public: MaxCollector() : Collector() { } - void collect(Quantity value) { + void collect(Quantity value) override { Collector::collect(value); if (first || value > q) q = value; @@ -2493,9 +2493,7 @@ VariableExpression::VariableExpression(const DocumentObject *_owner, const Objec { } -VariableExpression::~VariableExpression() -{ -} +VariableExpression::~VariableExpression() = default; /** * Determine if the expression is touched or not, i.e whether the Property object it diff --git a/src/App/Expression.h b/src/App/Expression.h index 2e45116b63..1861e151c2 100644 --- a/src/App/Expression.h +++ b/src/App/Expression.h @@ -55,7 +55,7 @@ typedef std::map _args = std::vector()); - virtual ~FunctionExpression(); + ~FunctionExpression() override; - virtual bool isTouched() const override; + bool isTouched() const override; - virtual Expression * simplify() const override; + Expression * simplify() const override; static Py::Object evaluate(const Expression *owner, int type, const std::vector &args); @@ -306,10 +306,10 @@ public: protected: static Py::Object evalAggregate(const Expression *owner, int type, const std::vector &args); - virtual Py::Object _getPyValue() const override; - virtual Expression * _copy() const override; - virtual void _visit(ExpressionVisitor & v) override; - virtual void _toString(std::ostream &ss, bool persistent, int indent) const override; + Py::Object _getPyValue() const override; + Expression * _copy() const override; + void _visit(ExpressionVisitor & v) override; + void _toString(std::ostream &ss, bool persistent, int indent) const override; Function f; /**< Function to execute */ std::string fname; @@ -329,11 +329,11 @@ class AppExport VariableExpression : public UnitExpression { public: VariableExpression(const App::DocumentObject *_owner = nullptr, const ObjectIdentifier& _var = ObjectIdentifier()); - ~VariableExpression(); + ~VariableExpression() override; - virtual bool isTouched() const override; + bool isTouched() const override; - virtual Expression * simplify() const override; + Expression * simplify() const override; std::string name() const { return var.getPropertyName(); } @@ -343,26 +343,26 @@ public: const App::Property *getProperty() const; - virtual void addComponent(Component* component) override; + void addComponent(Component* component) override; protected: - virtual Expression * _copy() const override; - virtual Py::Object _getPyValue() const override; - virtual void _toString(std::ostream &ss, bool persistent, int indent) const override; - virtual bool _isIndexable() const override; - virtual void _getIdentifiers(std::map &) const override; - virtual bool _adjustLinks(const std::set &, ExpressionVisitor &) override; - virtual void _importSubNames(const ObjectIdentifier::SubNameMap &) override; - virtual void _updateLabelReference(App::DocumentObject *, const std::string &, const char *) override; - virtual bool _updateElementReference(App::DocumentObject *,bool,ExpressionVisitor &) override; - virtual bool _relabeledDocument(const std::string &, const std::string &, ExpressionVisitor &) override; - virtual bool _renameObjectIdentifier(const std::map &, + Expression * _copy() const override; + Py::Object _getPyValue() const override; + void _toString(std::ostream &ss, bool persistent, int indent) const override; + bool _isIndexable() const override; + void _getIdentifiers(std::map &) const override; + bool _adjustLinks(const std::set &, ExpressionVisitor &) override; + void _importSubNames(const ObjectIdentifier::SubNameMap &) override; + void _updateLabelReference(App::DocumentObject *, const std::string &, const char *) override; + bool _updateElementReference(App::DocumentObject *,bool,ExpressionVisitor &) override; + bool _relabeledDocument(const std::string &, const std::string &, ExpressionVisitor &) override; + bool _renameObjectIdentifier(const std::map &, const ObjectIdentifier &, ExpressionVisitor &) override; - virtual void _collectReplacement(std::map &, + void _collectReplacement(std::map &, const App::DocumentObject *parent, App::DocumentObject *oldObj, App::DocumentObject *newObj) const override; - virtual void _moveCells(const CellAddress &, int, int, ExpressionVisitor &) override; - virtual void _offsetCells(int, int, ExpressionVisitor &) override; + void _moveCells(const CellAddress &, int, int, ExpressionVisitor &) override; + void _offsetCells(int, int, ExpressionVisitor &) override; protected: @@ -381,16 +381,16 @@ public: setPyValue(pyobj,owned); } - virtual ~PyObjectExpression(); + ~PyObjectExpression() override; void setPyValue(Py::Object pyobj); void setPyValue(PyObject *pyobj, bool owned=false); - virtual Expression * simplify() const override { return copy(); } + Expression * simplify() const override { return copy(); } protected: - virtual Expression* _copy() const override; - virtual void _toString(std::ostream &ss, bool persistent, int indent) const override; - virtual Py::Object _getPyValue() const override; + Expression* _copy() const override; + void _toString(std::ostream &ss, bool persistent, int indent) const override; + Py::Object _getPyValue() const override; protected: PyObject *pyObj = nullptr; @@ -405,16 +405,16 @@ class AppExport StringExpression : public Expression { TYPESYSTEM_HEADER_WITH_OVERRIDE(); public: StringExpression(const App::DocumentObject *_owner = nullptr, const std::string & _text = std::string()); - ~StringExpression(); + ~StringExpression() override; - virtual Expression * simplify() const override; + Expression * simplify() const override; virtual std::string getText() const { return text; } protected: - virtual Expression * _copy() const override; - virtual void _toString(std::ostream &ss, bool persistent, int indent) const override; - virtual Py::Object _getPyValue() const override; - virtual bool _isIndexable() const override { return true; } + Expression * _copy() const override; + void _toString(std::ostream &ss, bool persistent, int indent) const override; + Py::Object _getPyValue() const override; + bool _isIndexable() const override { return true; } private: std::string text; /**< Text string */ @@ -426,23 +426,23 @@ class AppExport RangeExpression : public App::Expression { public: RangeExpression(const App::DocumentObject * _owner = nullptr, const std::string & begin = std::string(), const std::string & end = std::string()); - virtual ~RangeExpression() { } + ~RangeExpression() override = default; - virtual bool isTouched() const override; + bool isTouched() const override; - virtual App::Expression * simplify() const override; + App::Expression * simplify() const override; Range getRange() const; protected: - virtual Expression * _copy() const override; - virtual void _toString(std::ostream &ss, bool persistent, int indent) const override; - virtual Py::Object _getPyValue() const override; - virtual void _getIdentifiers(std::map &) const override; - virtual bool _renameObjectIdentifier(const std::map &, + Expression * _copy() const override; + void _toString(std::ostream &ss, bool persistent, int indent) const override; + Py::Object _getPyValue() const override; + void _getIdentifiers(std::map &) const override; + bool _renameObjectIdentifier(const std::map &, const ObjectIdentifier &, ExpressionVisitor &) override; - virtual void _moveCells(const CellAddress &, int, int, ExpressionVisitor &) override; - virtual void _offsetCells(int, int, ExpressionVisitor &) override; + void _moveCells(const CellAddress &, int, int, ExpressionVisitor &) override; + void _offsetCells(int, int, ExpressionVisitor &) override; protected: std::string begin; diff --git a/src/App/ExtensionContainer.cpp b/src/App/ExtensionContainer.cpp index 49e7763a42..855cbfa73d 100644 --- a/src/App/ExtensionContainer.cpp +++ b/src/App/ExtensionContainer.cpp @@ -36,9 +36,7 @@ using namespace App; TYPESYSTEM_SOURCE(App::ExtensionContainer, App::PropertyContainer) -ExtensionContainer::ExtensionContainer() { - -} +ExtensionContainer::ExtensionContainer() = default; ExtensionContainer::~ExtensionContainer() { diff --git a/src/App/ExtensionContainer.h b/src/App/ExtensionContainer.h index 43b45eb25f..43132b5c89 100644 --- a/src/App/ExtensionContainer.h +++ b/src/App/ExtensionContainer.h @@ -117,7 +117,7 @@ public: typedef std::map::iterator ExtensionIterator; ExtensionContainer(); - virtual ~ExtensionContainer(); + ~ExtensionContainer() override; void registerExtension(Base::Type extension, App::Extension* ext); bool hasExtension(Base::Type, bool derived=true) const; //returns first of type (or derived from if set to true) and throws otherwise @@ -151,32 +151,32 @@ public: /** @name Access properties */ //@{ /// find a property by its name - virtual Property *getPropertyByName(const char* name) const override; + Property *getPropertyByName(const char* name) const override; /// get the name of a property - virtual const char* getPropertyName(const Property* prop) const override; + const char* getPropertyName(const Property* prop) const override; /// get all properties of the class (including properties of the parent) - virtual void getPropertyMap(std::map &Map) const override; + void getPropertyMap(std::map &Map) const override; /// get all properties of the class (including properties of the parent) - virtual void getPropertyList(std::vector &List) const override; + void getPropertyList(std::vector &List) const override; /// get the Type of a Property - virtual short getPropertyType(const Property* prop) const override; + short getPropertyType(const Property* prop) const override; /// get the Type of a named Property - virtual short getPropertyType(const char *name) const override; + short getPropertyType(const char *name) const override; /// get the Group of a Property - virtual const char* getPropertyGroup(const Property* prop) const override; + const char* getPropertyGroup(const Property* prop) const override; /// get the Group of a named Property - virtual const char* getPropertyGroup(const char *name) const override; + const char* getPropertyGroup(const char *name) const override; /// get the Group of a Property - virtual const char* getPropertyDocumentation(const Property* prop) const override; + const char* getPropertyDocumentation(const Property* prop) const override; /// get the Group of a named Property - virtual const char* getPropertyDocumentation(const char *name) const override; + const char* getPropertyDocumentation(const char *name) const override; //@} - virtual void onChanged(const Property*) override; + void onChanged(const Property*) override; - virtual void Save(Base::Writer& writer) const override; - virtual void Restore(Base::XMLReader& reader) override; + void Save(Base::Writer& writer) const override; + void Restore(Base::XMLReader& reader) override; //those methods save/restore the dynamic extensions without handling properties, which is something //done by the default Save/Restore methods. diff --git a/src/App/ExtensionPython.h b/src/App/ExtensionPython.h index 459517669a..275eedb483 100644 --- a/src/App/ExtensionPython.h +++ b/src/App/ExtensionPython.h @@ -46,8 +46,7 @@ public: ExtensionT::m_isPythonExtension = true; ExtensionT::initExtensionType(ExtensionPythonT::getExtensionClassTypeId()); } - virtual ~ExtensionPythonT() { - } + virtual ~ExtensionPythonT() = default; ExtensionPythonT(const ExtensionPythonT&) = delete; ExtensionPythonT(ExtensionPythonT&&) = delete; diff --git a/src/App/FeatureCustom.h b/src/App/FeatureCustom.h index d497dc9a88..6fbce3f8ff 100644 --- a/src/App/FeatureCustom.h +++ b/src/App/FeatureCustom.h @@ -45,11 +45,9 @@ class FeatureCustomT : public FeatureT PROPERTY_HEADER(App::FeatureCustomT); public: - FeatureCustomT() { - } + FeatureCustomT() = default; - virtual ~FeatureCustomT() { - } + virtual ~FeatureCustomT() = default; /** @name methods override DocumentObject */ //@{ diff --git a/src/App/FeaturePython.h b/src/App/FeaturePython.h index d90be211b3..e341d34f4c 100644 --- a/src/App/FeaturePython.h +++ b/src/App/FeaturePython.h @@ -187,7 +187,7 @@ public: return imp->mustExecute()?1:0; } /// recalculate the Feature - virtual DocumentObjectExecReturn *execute() override { + DocumentObjectExecReturn *execute() override { try { bool handled = imp->execute(); if (!handled) @@ -198,19 +198,19 @@ public: } return DocumentObject::StdReturn; } - virtual const char* getViewProviderNameOverride() const override { + const char* getViewProviderNameOverride() const override { viewProviderName = imp->getViewProviderName(); if(viewProviderName.size()) return viewProviderName.c_str(); return FeatureT::getViewProviderNameOverride(); } /// returns the type name of the ViewProvider - virtual const char* getViewProviderName() const override { + const char* getViewProviderName() const override { return FeatureT::getViewProviderName(); //return "Gui::ViewProviderPythonFeature"; } - virtual App::DocumentObject *getSubObject(const char *subname, PyObject **pyObj, + App::DocumentObject *getSubObject(const char *subname, PyObject **pyObj, Base::Matrix4D *mat, bool transform, int depth) const override { App::DocumentObject *ret = nullptr; @@ -219,14 +219,14 @@ public: return FeatureT::getSubObject(subname,pyObj,mat,transform,depth); } - virtual std::vector getSubObjects(int reason=0) const override { + std::vector getSubObjects(int reason=0) const override { std::vector ret; if(imp->getSubObjects(ret,reason)) return ret; return FeatureT::getSubObjects(reason); } - virtual App::DocumentObject *getLinkedObject(bool recurse, + App::DocumentObject *getLinkedObject(bool recurse, Base::Matrix4D *mat, bool transform, int depth) const override { App::DocumentObject *ret = nullptr; @@ -236,7 +236,7 @@ public: } /// return true to activate tree view group object handling - virtual bool hasChildElement() const override { + bool hasChildElement() const override { switch (imp->hasChildElement()) { case FeaturePythonImp::Accepted: return true; @@ -247,21 +247,21 @@ public: } } /// Get sub-element visibility - virtual int isElementVisible(const char *element) const override { + int isElementVisible(const char *element) const override { int ret = imp->isElementVisible(element); if(ret == -2) return FeatureT::isElementVisible(element); return ret; } /// Set sub-element visibility - virtual int setElementVisible(const char *element, bool visible) override { + int setElementVisible(const char *element, bool visible) override { int ret = imp->setElementVisible(element,visible); if(ret == -2) return FeatureT::setElementVisible(element,visible); return ret; } - virtual bool canLinkProperties() const override { + bool canLinkProperties() const override { switch (imp->canLinkProperties()) { case FeaturePythonImp::Accepted: return true; @@ -272,7 +272,7 @@ public: } } - virtual bool allowDuplicateLabel() const override { + bool allowDuplicateLabel() const override { switch (imp->allowDuplicateLabel()) { case FeaturePythonImp::Accepted: return true; @@ -283,7 +283,7 @@ public: } } - virtual bool redirectSubName(std::ostringstream &ss, + bool redirectSubName(std::ostringstream &ss, App::DocumentObject *topParent, App::DocumentObject *child) const override { switch (imp->redirectSubName(ss,topParent,child)) { @@ -296,14 +296,14 @@ public: } } - virtual int canLoadPartial() const override { + int canLoadPartial() const override { int ret = imp->canLoadPartial(); if(ret>=0) return ret; return FeatureT::canLoadPartial(); } - virtual void editProperty(const char *propName) override { + void editProperty(const char *propName) override { if (!imp->editProperty(propName)) FeatureT::editProperty(propName); } @@ -323,21 +323,21 @@ public: } protected: - virtual void onBeforeChange(const Property* prop) override { + void onBeforeChange(const Property* prop) override { FeatureT::onBeforeChange(prop); imp->onBeforeChange(prop); } - virtual void onBeforeChangeLabel(std::string &newLabel) override{ + void onBeforeChangeLabel(std::string &newLabel) override{ if(!imp->onBeforeChangeLabel(newLabel)) FeatureT::onBeforeChangeLabel(newLabel); } - virtual void onChanged(const Property* prop) override { + void onChanged(const Property* prop) override { if(prop == &Proxy) imp->init(Proxy.getValue().ptr()); imp->onChanged(prop); FeatureT::onChanged(prop); } - virtual void onDocumentRestored() override { + void onDocumentRestored() override { imp->onDocumentRestored(); FeatureT::onDocumentRestored(); } diff --git a/src/App/FeatureTest.cpp b/src/App/FeatureTest.cpp index abf2e16c89..e40dfba616 100644 --- a/src/App/FeatureTest.cpp +++ b/src/App/FeatureTest.cpp @@ -112,10 +112,7 @@ FeatureTest::FeatureTest() QuantityOther.setUnit(Base::Unit(-3,1)); } -FeatureTest::~FeatureTest() -{ - -} +FeatureTest::~FeatureTest() = default; short FeatureTest::mustExecute() const { diff --git a/src/App/FeatureTest.h b/src/App/FeatureTest.h index 111e2f0590..720c199bef 100644 --- a/src/App/FeatureTest.h +++ b/src/App/FeatureTest.h @@ -41,7 +41,7 @@ class FeatureTest : public DocumentObject public: FeatureTest(); - ~FeatureTest(); + ~FeatureTest() override; // Standard Properties (PropertyStandard.h) App::PropertyInteger Integer; @@ -104,12 +104,12 @@ public: /** @name methods override Feature */ //@{ - virtual short mustExecute() const; + short mustExecute() const override; /// recalculate the Feature - virtual DocumentObjectExecReturn *execute(); + DocumentObjectExecReturn *execute() override; /// returns the type name of the ViewProvider //Hint: Probably it makes sense to have a view provider for unittests (e.g. Gui::ViewProviderTest) - virtual const char* getViewProviderName() const { + const char* getViewProviderName() const override { return "Gui::ViewProviderFeature"; } //@} @@ -127,9 +127,9 @@ public: App::PropertyInteger ExceptionType; /// recalculate the Feature and throw an exception - virtual DocumentObjectExecReturn *execute(); + DocumentObjectExecReturn *execute() override; /// returns the type name of the ViewProvider - virtual const char* getViewProviderName() const { + const char* getViewProviderName() const override { return "Gui::ViewProviderFeature"; } }; diff --git a/src/App/GeoFeature.cpp b/src/App/GeoFeature.cpp index 8be48a9c7f..4808e0a648 100644 --- a/src/App/GeoFeature.cpp +++ b/src/App/GeoFeature.cpp @@ -45,9 +45,7 @@ GeoFeature::GeoFeature() ADD_PROPERTY_TYPE(Placement,(Base::Placement()),nullptr,Prop_NoRecompute,nullptr); } -GeoFeature::~GeoFeature() -{ -} +GeoFeature::~GeoFeature() = default; void GeoFeature::transformPlacement(const Base::Placement &transform) { diff --git a/src/App/GeoFeature.h b/src/App/GeoFeature.h index 16590395fd..100ac8299d 100644 --- a/src/App/GeoFeature.h +++ b/src/App/GeoFeature.h @@ -43,7 +43,7 @@ public: /// Constructor GeoFeature(); - virtual ~GeoFeature(); + ~GeoFeature() override; /** * @brief transformPlacement applies transform to placement of this shape. @@ -64,7 +64,7 @@ public: * @brief getPyObject returns the Python binding object * @return the Python binding object */ - virtual PyObject* getPyObject(); + PyObject* getPyObject() override; /// Specify the type of element name to return when calling getElementName() enum ElementNameType { diff --git a/src/App/GeoFeatureGroupExtension.cpp b/src/App/GeoFeatureGroupExtension.cpp index 68ca65a322..db154a8f0a 100644 --- a/src/App/GeoFeatureGroupExtension.cpp +++ b/src/App/GeoFeatureGroupExtension.cpp @@ -50,9 +50,7 @@ GeoFeatureGroupExtension::GeoFeatureGroupExtension() Group.setScope(LinkScope::Child); } -GeoFeatureGroupExtension::~GeoFeatureGroupExtension() -{ -} +GeoFeatureGroupExtension::~GeoFeatureGroupExtension() = default; void GeoFeatureGroupExtension::initExtension(ExtensionContainer* obj) { diff --git a/src/App/GeoFeatureGroupExtension.h b/src/App/GeoFeatureGroupExtension.h index 448e7cb309..3069846a20 100644 --- a/src/App/GeoFeatureGroupExtension.h +++ b/src/App/GeoFeatureGroupExtension.h @@ -56,7 +56,7 @@ class AppExport GeoFeatureGroupExtension : public App::GroupExtension public: PropertyPlacement& placement(); - virtual void initExtension(ExtensionContainer* obj) override; + void initExtension(ExtensionContainer* obj) override; /** * @brief transformPlacement applies transform to placement of this shape. @@ -68,9 +68,9 @@ public: /// Constructor GeoFeatureGroupExtension(); - virtual ~GeoFeatureGroupExtension(); + ~GeoFeatureGroupExtension() override; - virtual void extensionOnChanged(const Property* p) override; + void extensionOnChanged(const Property* p) override; /** Returns the geo feature group which contains this object. * In case this object is not part of any geoFeatureGroup 0 is returned. @@ -97,13 +97,13 @@ public: !obj->hasExtension(GeoFeatureGroupExtension::getExtensionClassTypeId()); } - virtual bool extensionGetSubObject(DocumentObject *&ret, const char *subname, PyObject **pyObj, + bool extensionGetSubObject(DocumentObject *&ret, const char *subname, PyObject **pyObj, Base::Matrix4D *mat, bool transform, int depth) const override; - virtual bool extensionGetSubObjects(std::vector &ret, int reason) const override; + bool extensionGetSubObjects(std::vector &ret, int reason) const override; - virtual std::vector< DocumentObject* > addObjects(std::vector< DocumentObject* > obj) override; - virtual std::vector< DocumentObject* > removeObjects(std::vector< DocumentObject* > obj) override; + std::vector< DocumentObject* > addObjects(std::vector< DocumentObject* > obj) override; + std::vector< DocumentObject* > removeObjects(std::vector< DocumentObject* > obj) override; /// Collects all links that are relevant for the coordinate system, meaning all recursive links to /// obj and from obj excluding expressions and stopping the recursion at other geofeaturegroups. diff --git a/src/App/GroupExtension.cpp b/src/App/GroupExtension.cpp index 902deebc8f..e3fd311331 100644 --- a/src/App/GroupExtension.cpp +++ b/src/App/GroupExtension.cpp @@ -52,9 +52,7 @@ GroupExtension::GroupExtension() PropertyType(Prop_Hidden|Prop_Transient),0); } -GroupExtension::~GroupExtension() -{ -} +GroupExtension::~GroupExtension() = default; DocumentObject* GroupExtension::addObject(const char* sType, const char* pObjectName) { diff --git a/src/App/GroupExtension.h b/src/App/GroupExtension.h index aa728669d6..05588df0b7 100644 --- a/src/App/GroupExtension.h +++ b/src/App/GroupExtension.h @@ -43,7 +43,7 @@ class AppExport GroupExtension : public DocumentObjectExtension public: /// Constructor GroupExtension(); - virtual ~GroupExtension(); + ~GroupExtension() override; /** @name Object handling */ //@{ @@ -107,16 +107,16 @@ public: static DocumentObject* getGroupOfObject(const DocumentObject* obj); //@} - virtual PyObject* getExtensionPyObject() override; + PyObject* getExtensionPyObject() override; - virtual void extensionOnChanged(const Property* p) override; + void extensionOnChanged(const Property* p) override; - virtual bool extensionGetSubObject(DocumentObject *&ret, const char *subname, + bool extensionGetSubObject(DocumentObject *&ret, const char *subname, PyObject **pyObj, Base::Matrix4D *mat, bool transform, int depth) const override; - virtual bool extensionGetSubObjects(std::vector &ret, int reason) const override; + bool extensionGetSubObjects(std::vector &ret, int reason) const override; - virtual App::DocumentObjectExecReturn *extensionExecute() override; + App::DocumentObjectExecReturn *extensionExecute() override; std::vector getAllChildren() const; void getAllChildren(std::vector &, std::set &) const; @@ -142,11 +142,11 @@ class GroupExtensionPythonT : public ExtensionT { public: - GroupExtensionPythonT() {} - virtual ~GroupExtensionPythonT() {} + GroupExtensionPythonT() = default; + virtual ~GroupExtensionPythonT() = default; //override the documentobjectextension functions to make them available in python - virtual bool allowObject(DocumentObject* obj) override { + bool allowObject(DocumentObject* obj) override { Py::Object pyobj = Py::asObject(obj->getPyObject()); EXTENSION_PROXY_ONEARG(allowObject, pyobj); diff --git a/src/App/InventorObject.cpp b/src/App/InventorObject.cpp index b9827ac44a..eded2a6f57 100644 --- a/src/App/InventorObject.cpp +++ b/src/App/InventorObject.cpp @@ -38,9 +38,7 @@ InventorObject::InventorObject() ADD_PROPERTY_TYPE(FileName,(""),"",Prop_None,"Path to an Inventor file"); } -InventorObject::~InventorObject() -{ -} +InventorObject::~InventorObject() = default; short InventorObject::mustExecute() const { diff --git a/src/App/InventorObject.h b/src/App/InventorObject.h index 89b01064b9..0337ea2cd6 100644 --- a/src/App/InventorObject.h +++ b/src/App/InventorObject.h @@ -38,17 +38,17 @@ class AppExport InventorObject : public GeoFeature public: /// Constructor InventorObject(); - virtual ~InventorObject(); + ~InventorObject() override; /// returns the type name of the ViewProvider - virtual const char* getViewProviderName() const { + const char* getViewProviderName() const override { return "Gui::ViewProviderInventorObject"; } - virtual DocumentObjectExecReturn *execute() { + DocumentObjectExecReturn *execute() override { return DocumentObject::StdReturn; } - virtual short mustExecute() const; - virtual PyObject *getPyObject(); + short mustExecute() const override; + PyObject *getPyObject() override; PropertyString Buffer; PropertyString FileName; diff --git a/src/App/MaterialObject.h b/src/App/MaterialObject.h index bc5d68c1ab..b929e1ef48 100644 --- a/src/App/MaterialObject.h +++ b/src/App/MaterialObject.h @@ -38,13 +38,13 @@ class AppExport MaterialObject : public DocumentObject public: /// Constructor MaterialObject(); - virtual ~MaterialObject(); + ~MaterialObject() override; App::PropertyMap Material; /// returns the type name of the ViewProvider - const char* getViewProviderName() const { + const char* getViewProviderName() const override { return "Gui::ViewProviderMaterialObject"; } diff --git a/src/App/MeasureDistance.cpp b/src/App/MeasureDistance.cpp index 05af0a213e..08d6f63f36 100644 --- a/src/App/MeasureDistance.cpp +++ b/src/App/MeasureDistance.cpp @@ -39,9 +39,7 @@ MeasureDistance::MeasureDistance() } -MeasureDistance::~MeasureDistance() -{ -} +MeasureDistance::~MeasureDistance() = default; DocumentObjectExecReturn *MeasureDistance::execute() { diff --git a/src/App/MeasureDistance.h b/src/App/MeasureDistance.h index 8c26695818..dd3316a2a6 100644 --- a/src/App/MeasureDistance.h +++ b/src/App/MeasureDistance.h @@ -39,22 +39,22 @@ class AppExport MeasureDistance : public DocumentObject public: /// Constructor MeasureDistance(); - virtual ~MeasureDistance(); + ~MeasureDistance() override; App::PropertyVector P1; App::PropertyVector P2; App::PropertyDistance Distance; /// recalculate the object - virtual DocumentObjectExecReturn *execute(); + DocumentObjectExecReturn *execute() override; /// returns the type name of the ViewProvider - const char* getViewProviderName() const { + const char* getViewProviderName() const override { return "Gui::ViewProviderMeasureDistance"; } protected: - virtual void onChanged(const Property* prop); + void onChanged(const Property* prop) override; }; } //namespace App diff --git a/src/App/MergeDocuments.cpp b/src/App/MergeDocuments.cpp index 6c0467d635..81c365a2b3 100644 --- a/src/App/MergeDocuments.cpp +++ b/src/App/MergeDocuments.cpp @@ -45,11 +45,11 @@ public: : Base::XMLReader(FileName, str), nameMap(name) {} - void addName(const char* s1, const char* s2) + void addName(const char* s1, const char* s2) override { nameMap[s1] = s2; } - const char* getName(const char* name) const + const char* getName(const char* name) const override { std::map::const_iterator it = nameMap.find(name); if (it != nameMap.end()) @@ -57,7 +57,7 @@ public: else return name; } - bool doNameMapping() const + bool doNameMapping() const override { return true; } diff --git a/src/App/MergeDocuments.h b/src/App/MergeDocuments.h index 3ddf342e2b..1fed28a880 100644 --- a/src/App/MergeDocuments.h +++ b/src/App/MergeDocuments.h @@ -37,17 +37,17 @@ class AppExport MergeDocuments : public Base::Persistence { public: MergeDocuments(App::Document* doc); - ~MergeDocuments(); + ~MergeDocuments() override; bool isVerbose() const { return verbose; } void setVerbose(bool on) { verbose = on; } - unsigned int getMemSize () const; + unsigned int getMemSize () const override; std::vector importObjects(std::istream&); void importObject(const std::vector& o, Base::XMLReader & r); void exportObject(const std::vector& o, Base::Writer & w); - void Save (Base::Writer & w) const; - void Restore(Base::XMLReader &r); - void SaveDocFile (Base::Writer & w) const; - void RestoreDocFile(Base::Reader & r); + void Save (Base::Writer & w) const override; + void Restore(Base::XMLReader &r) override; + void SaveDocFile (Base::Writer & w) const override; + void RestoreDocFile(Base::Reader & r) override; const std::map &getNameMap() const {return nameMap;} diff --git a/src/App/Metadata.cpp b/src/App/Metadata.cpp index 6a7cc05907..f2a2ad15da 100644 --- a/src/App/Metadata.cpp +++ b/src/App/Metadata.cpp @@ -59,13 +59,13 @@ XERCES_CPP_NAMESPACE_USE namespace MetadataInternal { class XMLErrorHandler : public HandlerBase { - void warning(const SAXParseException& toCatch) + void warning(const SAXParseException& toCatch) override { // Don't deal with warnings at all boost::ignore_unused(toCatch); } - void error(const SAXParseException& toCatch) + void error(const SAXParseException& toCatch) override { std::stringstream message; message << "Error at file \"" << StrX(toCatch.getSystemId()) @@ -75,7 +75,7 @@ namespace MetadataInternal { throw Base::XMLBaseException(message.str()); } - void fatalError(const SAXParseException& toCatch) + void fatalError(const SAXParseException& toCatch) override { std::stringstream message; message << "Fatal error at file \"" << StrX(toCatch.getSystemId()) @@ -140,9 +140,7 @@ Metadata::Metadata(const DOMNode* domNode, int format) : _dom(nullptr) } } -Metadata::~Metadata() -{ -} +Metadata::~Metadata() = default; std::string Metadata::name() const { diff --git a/src/App/ObjectIdentifier.h b/src/App/ObjectIdentifier.h index c1e6db6cc1..947c0799d1 100644 --- a/src/App/ObjectIdentifier.h +++ b/src/App/ObjectIdentifier.h @@ -268,7 +268,7 @@ public: return *this; } - virtual ~ObjectIdentifier() {} + virtual ~ObjectIdentifier() = default; App::DocumentObject *getOwner() const { return owner; } diff --git a/src/App/Origin.cpp b/src/App/Origin.cpp index b3712298df..131ebaabc2 100644 --- a/src/App/Origin.cpp +++ b/src/App/Origin.cpp @@ -57,8 +57,7 @@ Origin::Origin() : extension(this) { } -Origin::~Origin() -{ } +Origin::~Origin() = default; App::OriginFeature *Origin::getOriginFeature( const char *role) const { const auto & features = OriginFeatures.getValues (); diff --git a/src/App/Origin.h b/src/App/Origin.h index 5dfb0f124f..2765d4dba2 100644 --- a/src/App/Origin.h +++ b/src/App/Origin.h @@ -41,10 +41,10 @@ class AppExport Origin : public App::DocumentObject public: /// Constructor Origin(); - virtual ~Origin(); + ~Origin() override; /// returns the type name of the ViewProvider - virtual const char* getViewProviderName() const { + const char* getViewProviderName() const override { return "Gui::ViewProviderOrigin"; } @@ -112,7 +112,7 @@ public: static Base::BoundBox3d defaultBoundBox(); /// Returns true on changing OriginFeature set - virtual short mustExecute() const; + short mustExecute() const override; /// Axis types static const char* AxisRoles[3]; @@ -124,11 +124,11 @@ public: protected: /// Checks integrity of the Origin - virtual App::DocumentObjectExecReturn *execute(); + App::DocumentObjectExecReturn *execute() override; /// Creates all corresponding Axes and Planes objects for the origin if they aren't linked yet - virtual void setupObject (); + void setupObject () override; /// Removes all planes and axis if they are still linked to the document - virtual void unsetupObject (); + void unsetupObject () override; private: struct SetupData; @@ -138,9 +138,9 @@ private: Origin* obj; public: OriginExtension(Origin* obj); - void initExtension(ExtensionContainer* obj); + void initExtension(ExtensionContainer* obj) override; bool extensionGetSubObject(DocumentObject *&ret, const char *subname, - PyObject **, Base::Matrix4D *, bool, int) const; + PyObject **, Base::Matrix4D *, bool, int) const override; }; OriginExtension extension; }; diff --git a/src/App/OriginFeature.cpp b/src/App/OriginFeature.cpp index 35c2acd0bd..2171207687 100644 --- a/src/App/OriginFeature.cpp +++ b/src/App/OriginFeature.cpp @@ -41,8 +41,7 @@ OriginFeature::OriginFeature() Placement.setStatus(Property::Hidden, true); } -OriginFeature::~OriginFeature() -{ } +OriginFeature::~OriginFeature() = default; Origin * OriginFeature::getOrigin () { App::Document *doc = getDocument(); diff --git a/src/App/OriginFeature.h b/src/App/OriginFeature.h index b95e715e47..dde6c39b60 100644 --- a/src/App/OriginFeature.h +++ b/src/App/OriginFeature.h @@ -42,7 +42,7 @@ public: /// Constructor OriginFeature(); - virtual ~OriginFeature(); + ~OriginFeature() override; /// Finds the origin object this plane belongs to App::Origin *getOrigin (); @@ -51,7 +51,7 @@ public: class AppExport Plane: public App::OriginFeature { PROPERTY_HEADER(App::OriginFeature); public: - virtual const char* getViewProviderName() const { + const char* getViewProviderName() const override { return "Gui::ViewProviderPlane"; } }; @@ -59,7 +59,7 @@ public: class AppExport Line: public App::OriginFeature { PROPERTY_HEADER(App::OriginFeature); public: - virtual const char* getViewProviderName() const { + const char* getViewProviderName() const override { return "Gui::ViewProviderLine"; } }; diff --git a/src/App/OriginGroupExtension.cpp b/src/App/OriginGroupExtension.cpp index e8606c215d..d61a17cb55 100644 --- a/src/App/OriginGroupExtension.cpp +++ b/src/App/OriginGroupExtension.cpp @@ -46,8 +46,7 @@ OriginGroupExtension::OriginGroupExtension () { Origin.setScope(LinkScope::Child); } -OriginGroupExtension::~OriginGroupExtension () -{ } +OriginGroupExtension::~OriginGroupExtension () = default; App::Origin *OriginGroupExtension::getOrigin () const { App::DocumentObject *originObj = Origin.getValue (); diff --git a/src/App/OriginGroupExtension.h b/src/App/OriginGroupExtension.h index cf3a4f2251..f5ea25ad43 100644 --- a/src/App/OriginGroupExtension.h +++ b/src/App/OriginGroupExtension.h @@ -37,7 +37,7 @@ class AppExport OriginGroupExtension : public App::GeoFeatureGroupExtension public: OriginGroupExtension (); - virtual ~OriginGroupExtension (); + ~OriginGroupExtension () override; /// Returns the origin link or throws an exception App::Origin *getOrigin () const; @@ -55,7 +55,7 @@ public: static DocumentObject* getGroupOfObject (const DocumentObject* obj); /// Returns true on changing OriginFeature set - virtual short extensionMustExecute () override; + short extensionMustExecute () override; /// Origin linked to the group PropertyLink Origin; @@ -63,21 +63,21 @@ public: // changes all links of obj to a origin to point to this groups origin void relinkToOrigin(App::DocumentObject* obj); - virtual std::vector addObjects(std::vector obj) override; - virtual bool hasObject(const DocumentObject* obj, bool recursive = false) const override; + std::vector addObjects(std::vector obj) override; + bool hasObject(const DocumentObject* obj, bool recursive = false) const override; - virtual bool extensionGetSubObject(DocumentObject *&ret, const char *subname, PyObject **pyObj, + bool extensionGetSubObject(DocumentObject *&ret, const char *subname, PyObject **pyObj, Base::Matrix4D *mat, bool transform, int depth) const override; - virtual void extensionOnChanged(const Property* p) override; + void extensionOnChanged(const Property* p) override; protected: /// Checks integrity of the Origin - virtual App::DocumentObjectExecReturn *extensionExecute () override; + App::DocumentObjectExecReturn *extensionExecute () override; /// Creates the corresponding Origin object - virtual void onExtendedSetupObject () override; + void onExtendedSetupObject () override; /// Removes all planes and axis if they are still linked to the document - virtual void onExtendedUnsetupObject () override; + void onExtendedUnsetupObject () override; }; typedef ExtensionPythonT> OriginGroupExtensionPython; diff --git a/src/App/Part.cpp b/src/App/Part.cpp index e9c56ee675..3ce9e5d207 100644 --- a/src/App/Part.cpp +++ b/src/App/Part.cpp @@ -60,9 +60,7 @@ Part::Part() GroupExtension::initExtension(this); } -Part::~Part() -{ -} +Part::~Part() = default; static App::Part *_getPartOfObject(const DocumentObject *obj, std::set *objset) diff --git a/src/App/Part.h b/src/App/Part.h index 2ae9d33e44..f217bc67c5 100644 --- a/src/App/Part.h +++ b/src/App/Part.h @@ -77,15 +77,15 @@ public: /// Constructor Part(); - virtual ~Part(); + ~Part() override; /// returns the type name of the ViewProvider - virtual const char* getViewProviderName() const override { + const char* getViewProviderName() const override { return "Gui::ViewProviderPart"; } - virtual void handleChangedPropertyType(Base::XMLReader &reader, const char *TypeName, App::Property *prop) override; + void handleChangedPropertyType(Base::XMLReader &reader, const char *TypeName, App::Property *prop) override; /** * Returns the part which contains this object. @@ -95,7 +95,7 @@ public: */ static App::Part* getPartOfObject (const DocumentObject* obj, bool recursive=true); - virtual PyObject *getPyObject() override; + PyObject *getPyObject() override; }; //typedef App::FeaturePythonT PartPython; diff --git a/src/App/Path.cpp b/src/App/Path.cpp index 421293f54b..e4ea5d71e3 100644 --- a/src/App/Path.cpp +++ b/src/App/Path.cpp @@ -28,16 +28,12 @@ using namespace App; -Path::Path() -{ -} +Path::Path() = default; Path::Path(const std::vector &PathVector) :_PathVector(PathVector) { } -Path::~Path() -{ -} +Path::~Path() = default; diff --git a/src/App/Placement.cpp b/src/App/Placement.cpp index a8c95aa527..6a47e88c8f 100644 --- a/src/App/Placement.cpp +++ b/src/App/Placement.cpp @@ -37,14 +37,9 @@ PROPERTY_SOURCE(App::Placement, App::GeoFeature) // Feature //=========================================================================== -Placement::Placement() -{ +Placement::Placement() = default; -} - -Placement::~Placement() -{ -} +Placement::~Placement() = default; diff --git a/src/App/Placement.h b/src/App/Placement.h index 633adf8fde..65db05a014 100644 --- a/src/App/Placement.h +++ b/src/App/Placement.h @@ -39,10 +39,10 @@ class AppExport Placement: public App::GeoFeature public: /// Constructor Placement(); - virtual ~Placement(); + ~Placement() override; /// returns the type name of the ViewProvider - virtual const char* getViewProviderName() const { + const char* getViewProviderName() const override { return "Gui::ViewProviderPlacement"; } diff --git a/src/App/Property.cpp b/src/App/Property.cpp index bb26a6d0a7..aa3ba1a047 100644 --- a/src/App/Property.cpp +++ b/src/App/Property.cpp @@ -58,10 +58,7 @@ Property::Property() { } -Property::~Property() -{ - -} +Property::~Property() = default; const char* Property::getName() const { diff --git a/src/App/Property.h b/src/App/Property.h index 12ba2bc23f..f0b494f61b 100644 --- a/src/App/Property.h +++ b/src/App/Property.h @@ -101,7 +101,7 @@ public: }; Property(); - virtual ~Property(); + ~Property() override; /// For safe deleting of a dynamic property static void destroy(Property *p); @@ -112,7 +112,7 @@ public: * This method is defined in Base::Persistence * @see Base::Persistence */ - virtual unsigned int getMemSize () const override { + unsigned int getMemSize () const override { // you have to implement this method in all property classes! return sizeof(father) + sizeof(StatusBits); } @@ -456,7 +456,7 @@ class AppExport PropertyLists : public Property, public PropertyListsBase { TYPESYSTEM_HEADER_WITH_OVERRIDE(); public: - virtual void setPyObject(PyObject *obj) override { + void setPyObject(PyObject *obj) override { _setPyObject(obj); } @@ -486,11 +486,11 @@ public: _lValueList.resize(newSize,def); } - virtual void setSize(int newSize) override { + void setSize(int newSize) override { _lValueList.resize(newSize); } - virtual int getSize() const override { + int getSize() const override { return static_cast(_lValueList.size()); } @@ -518,14 +518,14 @@ public: const_reference operator[] (int idx) const {return _lValueList[idx];} - virtual bool isSame(const Property &other) const override { + bool isSame(const Property &other) const override { if (&other == this) return true; return this->getTypeId() == other.getTypeId() && this->getValue() == static_cast(&other)->getValue(); } - virtual void setPyObject(PyObject *value) override { + void setPyObject(PyObject *value) override { try { setValue(getPyValue(value)); return; diff --git a/src/App/PropertyContainer.cpp b/src/App/PropertyContainer.cpp index 51d147911c..d12c89c3bf 100644 --- a/src/App/PropertyContainer.cpp +++ b/src/App/PropertyContainer.cpp @@ -50,10 +50,7 @@ PropertyContainer::PropertyContainer() propertyData.parentPropertyData = nullptr; } -PropertyContainer::~PropertyContainer() -{ - -} +PropertyContainer::~PropertyContainer() = default; unsigned int PropertyContainer::getMemSize () const { diff --git a/src/App/PropertyContainer.h b/src/App/PropertyContainer.h index 339de9455d..014f4c31e1 100644 --- a/src/App/PropertyContainer.h +++ b/src/App/PropertyContainer.h @@ -154,9 +154,9 @@ public: * A destructor. * A more elaborate description of the destructor. */ - virtual ~PropertyContainer(); + ~PropertyContainer() override; - virtual unsigned int getMemSize () const; + unsigned int getMemSize () const override; virtual std::string getFullName() const {return std::string();} @@ -218,8 +218,8 @@ public: virtual void onPropertyStatusChanged(const Property &prop, unsigned long oldStatus); - virtual void Save (Base::Writer &writer) const; - virtual void Restore(Base::XMLReader &reader); + void Save (Base::Writer &writer) const override; + void Restore(Base::XMLReader &reader) override; virtual void editProperty(const char * /*propName*/) {} diff --git a/src/App/PropertyExpressionEngine.cpp b/src/App/PropertyExpressionEngine.cpp index f8c92e7a46..c1063c4192 100644 --- a/src/App/PropertyExpressionEngine.cpp +++ b/src/App/PropertyExpressionEngine.cpp @@ -96,9 +96,7 @@ PropertyExpressionEngine::PropertyExpressionEngine() * @brief Destroy the PropertyExpressionEngine object. */ -PropertyExpressionEngine::~PropertyExpressionEngine() -{ -} +PropertyExpressionEngine::~PropertyExpressionEngine() = default; /** * @brief Estimate memory size of this property. diff --git a/src/App/PropertyExpressionEngine.h b/src/App/PropertyExpressionEngine.h index 8c5620c0e8..774503549d 100644 --- a/src/App/PropertyExpressionEngine.h +++ b/src/App/PropertyExpressionEngine.h @@ -49,7 +49,7 @@ class AppExport PropertyExpressionContainer : public App::PropertyXLinkContainer TYPESYSTEM_HEADER(); public: PropertyExpressionContainer(); - virtual ~PropertyExpressionContainer(); + ~PropertyExpressionContainer() override; virtual std::map getExpressions() const = 0; virtual void setExpressions(std::map &&exprs) = 0; @@ -67,14 +67,14 @@ class AppExport PropertyExpressionEngine : public App::PropertyExpressionContain TYPESYSTEM_HEADER_WITH_OVERRIDE(); public: - virtual void updateElementReference( + void updateElementReference( App::DocumentObject *feature, bool reverse=false, bool notify=false) override; - virtual bool referenceChanged() const override; - virtual bool adjustLink(const std::set &inList) override; - virtual Property *CopyOnImportExternal(const std::map &nameMap) const override; - virtual Property *CopyOnLabelChange(App::DocumentObject *obj, + bool referenceChanged() const override; + bool adjustLink(const std::set &inList) override; + Property *CopyOnImportExternal(const std::map &nameMap) const override; + Property *CopyOnLabelChange(App::DocumentObject *obj, const std::string &ref, const char *newLabel) const override; - virtual Property *CopyOnLinkReplace(const App::DocumentObject *parent, + Property *CopyOnLinkReplace(const App::DocumentObject *parent, App::DocumentObject *oldObj, App::DocumentObject *newObj) const override; typedef std::function expr)> ValidatorFunc; @@ -105,13 +105,13 @@ public: }; PropertyExpressionEngine(); - ~PropertyExpressionEngine(); + ~PropertyExpressionEngine() override; unsigned int getMemSize () const override; - virtual std::map getExpressions() const override; - virtual void setExpressions(std::map &&exprs) override; - virtual void onRelabeledDocument(const App::Document &doc) override; + std::map getExpressions() const override; + void setExpressions(std::map &&exprs) override; + void onRelabeledDocument(const App::Document &doc) override; void setValue() { } // Dummy @@ -164,15 +164,15 @@ public: ///signal called when an expression was changed boost::signals2::signal expressionChanged; - virtual void afterRestore() override; - virtual void onContainerRestored() override; + void afterRestore() override; + void onContainerRestored() override; /* Python interface */ PyObject *getPyObject() override; void setPyObject(PyObject *) override; protected: - virtual void hasSetValue() override; + void hasSetValue() override; private: diff --git a/src/App/PropertyFile.cpp b/src/App/PropertyFile.cpp index 7afa834a50..60870f1b79 100644 --- a/src/App/PropertyFile.cpp +++ b/src/App/PropertyFile.cpp @@ -49,10 +49,7 @@ using namespace std; TYPESYSTEM_SOURCE(App::PropertyFileIncluded , App::Property) -PropertyFileIncluded::PropertyFileIncluded() -{ - -} +PropertyFileIncluded::PropertyFileIncluded() = default; PropertyFileIncluded::~PropertyFileIncluded() { @@ -583,10 +580,7 @@ PropertyFile::PropertyFile() m_filter = ""; } -PropertyFile::~PropertyFile() -{ - -} +PropertyFile::~PropertyFile() = default; void PropertyFile::setFilter(const std::string f) { diff --git a/src/App/PropertyFile.h b/src/App/PropertyFile.h index 421651c67e..71c9047425 100644 --- a/src/App/PropertyFile.h +++ b/src/App/PropertyFile.h @@ -45,9 +45,9 @@ class AppExport PropertyFile : public PropertyString public: PropertyFile(); - virtual ~PropertyFile(); + ~PropertyFile() override; - virtual const char* getEditorName() const + const char* getEditorName() const override { return "Gui::PropertyEditor::PropertyFileItem"; } virtual void setFilter(const std::string filter); @@ -77,27 +77,27 @@ class AppExport PropertyFileIncluded : public Property public: PropertyFileIncluded(); - virtual ~PropertyFileIncluded(); + ~PropertyFileIncluded() override; void setValue(const char* sFile, const char* sName=nullptr); const char* getValue() const; - virtual const char* getEditorName() const + const char* getEditorName() const override { return "Gui::PropertyEditor::PropertyTransientFileItem"; } - virtual PyObject *getPyObject(); - virtual void setPyObject(PyObject *); + PyObject *getPyObject() override; + void setPyObject(PyObject *) override; - virtual void Save (Base::Writer &writer) const; - virtual void Restore(Base::XMLReader &reader); + void Save (Base::Writer &writer) const override; + void Restore(Base::XMLReader &reader) override; - virtual void SaveDocFile (Base::Writer &writer) const; - virtual void RestoreDocFile(Base::Reader &reader); + void SaveDocFile (Base::Writer &writer) const override; + void RestoreDocFile(Base::Reader &reader) override; - virtual Property *Copy() const; - virtual void Paste(const Property &from); - virtual unsigned int getMemSize () const; + Property *Copy() const override; + void Paste(const Property &from) override; + unsigned int getMemSize () const override; - virtual bool isSame(const Property &other) const { + bool isSame(const Property &other) const override { if (&other == this) return true; return getTypeId() == other.getTypeId() @@ -120,7 +120,7 @@ protected: // get the transient path if the property is in a DocumentObject std::string getDocTransientPath() const; std::string getUniqueFileName(const std::string&, const std::string&) const; - void aboutToSetValue(); + void aboutToSetValue() override; protected: mutable std::string _cValue; diff --git a/src/App/PropertyGeo.cpp b/src/App/PropertyGeo.cpp index 53c23c823f..723f356288 100644 --- a/src/App/PropertyGeo.cpp +++ b/src/App/PropertyGeo.cpp @@ -59,16 +59,10 @@ TYPESYSTEM_SOURCE(App::PropertyVector , App::Property) // Construction/Destruction -PropertyVector::PropertyVector() -{ - -} +PropertyVector::PropertyVector() = default; -PropertyVector::~PropertyVector() -{ - -} +PropertyVector::~PropertyVector() = default; //************************************************************************** // Base class implementer @@ -225,15 +219,9 @@ TYPESYSTEM_SOURCE(App::PropertyVectorDistance , App::PropertyVector) // Construction/Destruction -PropertyVectorDistance::PropertyVectorDistance() -{ +PropertyVectorDistance::PropertyVectorDistance() = default; -} - -PropertyVectorDistance::~PropertyVectorDistance() -{ - -} +PropertyVectorDistance::~PropertyVectorDistance() = default; //************************************************************************** // PropertyPosition @@ -245,15 +233,9 @@ TYPESYSTEM_SOURCE(App::PropertyPosition , App::PropertyVector) // Construction/Destruction -PropertyPosition::PropertyPosition() -{ +PropertyPosition::PropertyPosition() = default; -} - -PropertyPosition::~PropertyPosition() -{ - -} +PropertyPosition::~PropertyPosition() = default; //************************************************************************** // PropertyPosition @@ -265,15 +247,9 @@ TYPESYSTEM_SOURCE(App::PropertyDirection , App::PropertyVector) // Construction/Destruction -PropertyDirection::PropertyDirection() -{ +PropertyDirection::PropertyDirection() = default; -} - -PropertyDirection::~PropertyDirection() -{ - -} +PropertyDirection::~PropertyDirection() = default; //************************************************************************** // PropertyVectorList @@ -284,15 +260,9 @@ TYPESYSTEM_SOURCE(App::PropertyVectorList , App::PropertyLists) //************************************************************************** // Construction/Destruction -PropertyVectorList::PropertyVectorList() -{ +PropertyVectorList::PropertyVectorList() = default; -} - -PropertyVectorList::~PropertyVectorList() -{ - -} +PropertyVectorList::~PropertyVectorList() = default; //************************************************************************** // Base class implementer @@ -405,16 +375,10 @@ TYPESYSTEM_SOURCE(App::PropertyMatrix , App::Property) // Construction/Destruction -PropertyMatrix::PropertyMatrix() -{ - -} +PropertyMatrix::PropertyMatrix() = default; -PropertyMatrix::~PropertyMatrix() -{ - -} +PropertyMatrix::~PropertyMatrix() = default; //************************************************************************** // Base class implementer @@ -533,16 +497,10 @@ TYPESYSTEM_SOURCE(App::PropertyPlacement , App::Property) // Construction/Destruction -PropertyPlacement::PropertyPlacement() -{ - -} +PropertyPlacement::PropertyPlacement() = default; -PropertyPlacement::~PropertyPlacement() -{ - -} +PropertyPlacement::~PropertyPlacement() = default; //************************************************************************** // Base class implementer @@ -763,15 +721,9 @@ TYPESYSTEM_SOURCE(App::PropertyPlacementList , App::PropertyLists) //************************************************************************** // Construction/Destruction -PropertyPlacementList::PropertyPlacementList() -{ +PropertyPlacementList::PropertyPlacementList() = default; -} - -PropertyPlacementList::~PropertyPlacementList() -{ - -} +PropertyPlacementList::~PropertyPlacementList() = default; //************************************************************************** // Base class implementer @@ -895,16 +847,10 @@ TYPESYSTEM_SOURCE(App::PropertyPlacementLink , App::PropertyLink) // Construction/Destruction -PropertyPlacementLink::PropertyPlacementLink() -{ - -} +PropertyPlacementLink::PropertyPlacementLink() = default; -PropertyPlacementLink::~PropertyPlacementLink() -{ - -} +PropertyPlacementLink::~PropertyPlacementLink() = default; App::Placement * PropertyPlacementLink::getPlacementObject() const { @@ -939,16 +885,10 @@ void PropertyPlacementLink::Paste(const Property &from) TYPESYSTEM_SOURCE(App::PropertyRotation , App::Property) -PropertyRotation::PropertyRotation() -{ - -} +PropertyRotation::PropertyRotation() = default; -PropertyRotation::~PropertyRotation() -{ - -} +PropertyRotation::~PropertyRotation() = default; void PropertyRotation::setValue(const Base::Rotation &rot) { @@ -1113,26 +1053,14 @@ void PropertyRotation::Paste(const Property &from) TYPESYSTEM_SOURCE_ABSTRACT(App::PropertyGeometry , App::Property) -PropertyGeometry::PropertyGeometry() -{ +PropertyGeometry::PropertyGeometry() = default; -} - -PropertyGeometry::~PropertyGeometry() -{ - -} +PropertyGeometry::~PropertyGeometry() = default; // ------------------------------------------------------------ TYPESYSTEM_SOURCE_ABSTRACT(App::PropertyComplexGeoData , App::PropertyGeometry) -PropertyComplexGeoData::PropertyComplexGeoData() -{ +PropertyComplexGeoData::PropertyComplexGeoData() = default; -} - -PropertyComplexGeoData::~PropertyComplexGeoData() -{ - -} +PropertyComplexGeoData::~PropertyComplexGeoData() = default; diff --git a/src/App/PropertyGeo.h b/src/App/PropertyGeo.h index 07d1152403..955c764760 100644 --- a/src/App/PropertyGeo.h +++ b/src/App/PropertyGeo.h @@ -67,7 +67,7 @@ public: * A destructor. * A more elaborate description of the destructor. */ - virtual ~PropertyVector(); + ~PropertyVector() override; /** Sets the property */ @@ -84,32 +84,32 @@ public: return "Gui::PropertyEditor::PropertyVectorItem"; } - virtual PyObject *getPyObject() override; - virtual void setPyObject(PyObject *) override; + PyObject *getPyObject() override; + void setPyObject(PyObject *) override; - virtual void Save (Base::Writer &writer) const override; - virtual void Restore(Base::XMLReader &reader) override; + void Save (Base::Writer &writer) const override; + void Restore(Base::XMLReader &reader) override; - virtual Property *Copy() const override; - virtual void Paste(const Property &from) override; + Property *Copy() const override; + void Paste(const Property &from) override; - virtual unsigned int getMemSize () const override { + unsigned int getMemSize () const override { return sizeof(Base::Vector3d); } - virtual const boost::any getPathValue(const ObjectIdentifier &path) const override; + const boost::any getPathValue(const ObjectIdentifier &path) const override; - virtual bool getPyPathValue(const ObjectIdentifier &path, Py::Object &res) const override; + bool getPyPathValue(const ObjectIdentifier &path, Py::Object &res) const override; virtual Base::Unit getUnit() const { return Base::Unit(); } - virtual bool isSame(const Property &other) const override { + bool isSame(const Property &other) const override { if (&other == this) return true; return getTypeId() == other.getTypeId() - && getValue() == static_cast(&other)->getValue(); + && getValue() == dynamic_cast(&other)->getValue(); } private: @@ -132,13 +132,13 @@ public: * A destructor. * A more elaborate description of the destructor. */ - virtual ~PropertyVectorDistance(); + ~PropertyVectorDistance() override; - virtual Base::Unit getUnit() const { + Base::Unit getUnit() const override { return Base::Unit::Length; } - const char* getEditorName() const { + const char* getEditorName() const override { return "Gui::PropertyEditor::PropertyVectorDistanceItem"; } }; @@ -158,13 +158,13 @@ public: * A destructor. * A more elaborate description of the destructor. */ - virtual ~PropertyPosition(); + ~PropertyPosition() override; - virtual Base::Unit getUnit() const { + Base::Unit getUnit() const override { return Base::Unit::Length; } - const char* getEditorName() const { + const char* getEditorName() const override { return "Gui::PropertyEditor::PropertyPositionItem"; } }; @@ -184,13 +184,13 @@ public: * A destructor. * A more elaborate description of the destructor. */ - virtual ~PropertyDirection(); + ~PropertyDirection() override; - virtual Base::Unit getUnit() const { + Base::Unit getUnit() const override { return Base::Unit::Length; } - const char* getEditorName() const { + const char* getEditorName() const override { return "Gui::PropertyEditor::PropertyDirectionItem"; } }; @@ -212,23 +212,23 @@ public: * A destructor. * A more elaborate description of the destructor. */ - virtual ~PropertyVectorList(); + ~PropertyVectorList() override; void setValue(double x, double y, double z); using inherited::setValue; - virtual PyObject *getPyObject() override; + PyObject *getPyObject() override; - virtual void Save (Base::Writer &writer) const override; - virtual void Restore(Base::XMLReader &reader) override; + void Save (Base::Writer &writer) const override; + void Restore(Base::XMLReader &reader) override; - virtual void SaveDocFile (Base::Writer &writer) const override; - virtual void RestoreDocFile(Base::Reader &reader) override; + void SaveDocFile (Base::Writer &writer) const override; + void RestoreDocFile(Base::Reader &reader) override; - virtual Property *Copy() const override; - virtual void Paste(const Property &from) override; + Property *Copy() const override; + void Paste(const Property &from) override; - virtual unsigned int getMemSize () const override; + unsigned int getMemSize () const override; const char* getEditorName() const override { return "Gui::PropertyEditor::PropertyVectorListItem"; } @@ -256,7 +256,7 @@ public: * A destructor. * A more elaborate description of the destructor. */ - virtual ~PropertyMatrix(); + ~PropertyMatrix() override; /** Sets the property */ @@ -265,24 +265,24 @@ public: /** This method returns a string representation of the property */ const Base::Matrix4D &getValue() const; - const char* getEditorName() const { + const char* getEditorName() const override { return "Gui::PropertyEditor::PropertyMatrixItem"; } - virtual PyObject *getPyObject(); - virtual void setPyObject(PyObject *); + PyObject *getPyObject() override; + void setPyObject(PyObject *) override; - virtual void Save (Base::Writer &writer) const; - virtual void Restore(Base::XMLReader &reader); + void Save (Base::Writer &writer) const override; + void Restore(Base::XMLReader &reader) override; - virtual Property *Copy() const; - virtual void Paste(const Property &from); + Property *Copy() const override; + void Paste(const Property &from) override; - virtual unsigned int getMemSize () const { + unsigned int getMemSize () const override { return sizeof(Base::Matrix4D); } - virtual bool isSame(const Property &other) const { + bool isSame(const Property &other) const override { if (&other == this) return true; return getTypeId() == other.getTypeId() @@ -312,7 +312,7 @@ public: * A destructor. * A more elaborate description of the destructor. */ - virtual ~PropertyPlacement(); + ~PropertyPlacement() override; /** Sets the property */ @@ -335,28 +335,28 @@ public: void setPathValue(const ObjectIdentifier &path, const boost::any &value) override; - virtual const boost::any getPathValue(const ObjectIdentifier &path) const override; + const boost::any getPathValue(const ObjectIdentifier &path) const override; - virtual bool getPyPathValue(const ObjectIdentifier &path, Py::Object &res) const override; + bool getPyPathValue(const ObjectIdentifier &path, Py::Object &res) const override; const char* getEditorName() const override { return "Gui::PropertyEditor::PropertyPlacementItem"; } - virtual PyObject *getPyObject() override; - virtual void setPyObject(PyObject *) override; + PyObject *getPyObject() override; + void setPyObject(PyObject *) override; - virtual void Save (Base::Writer &writer) const override; - virtual void Restore(Base::XMLReader &reader) override; + void Save (Base::Writer &writer) const override; + void Restore(Base::XMLReader &reader) override; - virtual Property *Copy() const override; - virtual void Paste(const Property &from) override; + Property *Copy() const override; + void Paste(const Property &from) override; - virtual unsigned int getMemSize () const override { + unsigned int getMemSize () const override { return sizeof(Base::Placement); } - virtual bool isSame(const Property &other) const override { + bool isSame(const Property &other) const override { if (&other == this) return true; return getTypeId() == other.getTypeId() @@ -387,14 +387,14 @@ public: * A destructor. * A more elaborate description of the destructor. */ - virtual ~PropertyPlacementLink(); + ~PropertyPlacementLink() override; /** This method returns the linked DocumentObject */ App::Placement * getPlacementObject() const; - virtual Property *Copy() const; - virtual void Paste(const Property &from); + Property *Copy() const override; + void Paste(const Property &from) override; }; @@ -408,20 +408,20 @@ public: */ PropertyPlacementList(); - virtual ~PropertyPlacementList(); + ~PropertyPlacementList() override; - virtual PyObject *getPyObject() override; + PyObject *getPyObject() override; - virtual void Save (Base::Writer &writer) const override; - virtual void Restore(Base::XMLReader &reader) override; + void Save (Base::Writer &writer) const override; + void Restore(Base::XMLReader &reader) override; - virtual void SaveDocFile (Base::Writer &writer) const override; - virtual void RestoreDocFile(Base::Reader &reader) override; + void SaveDocFile (Base::Writer &writer) const override; + void RestoreDocFile(Base::Reader &reader) override; - virtual Property *Copy() const override; - virtual void Paste(const Property &from) override; + Property *Copy() const override; + void Paste(const Property &from) override; - virtual unsigned int getMemSize () const override; + unsigned int getMemSize () const override; protected: Base::Placement getPyValue(PyObject *) const override; @@ -447,7 +447,7 @@ public: * A destructor. * A more elaborate description of the destructor. */ - virtual ~PropertyRotation(); + ~PropertyRotation() override; /** Sets the property */ @@ -469,24 +469,24 @@ public: void setPathValue(const ObjectIdentifier &path, const boost::any &value) override; - virtual const boost::any getPathValue(const ObjectIdentifier &path) const override; + const boost::any getPathValue(const ObjectIdentifier &path) const override; - virtual bool getPyPathValue(const ObjectIdentifier &path, Py::Object &res) const override; + bool getPyPathValue(const ObjectIdentifier &path, Py::Object &res) const override; const char* getEditorName() const override { return "Gui::PropertyEditor::PropertyRotationItem"; } - virtual PyObject *getPyObject() override; - virtual void setPyObject(PyObject *) override; + PyObject *getPyObject() override; + void setPyObject(PyObject *) override; - virtual void Save (Base::Writer &writer) const override; - virtual void Restore(Base::XMLReader &reader) override; + void Save (Base::Writer &writer) const override; + void Restore(Base::XMLReader &reader) override; - virtual Property *Copy() const override; - virtual void Paste(const Property &from) override; + Property *Copy() const override; + void Paste(const Property &from) override; - virtual unsigned int getMemSize () const override { + unsigned int getMemSize () const override { return sizeof(Base::Placement); } @@ -504,7 +504,7 @@ class AppExport PropertyGeometry : public App::Property public: PropertyGeometry(); - virtual ~PropertyGeometry(); + ~PropertyGeometry() override; /** @name Modification */ //@{ @@ -528,18 +528,18 @@ class AppExport PropertyComplexGeoData : public App::PropertyGeometry public: PropertyComplexGeoData(); - virtual ~PropertyComplexGeoData(); + ~PropertyComplexGeoData() override; /** @name Modification */ //@{ /// Applies a transformation on the real geometric data type - virtual void transformGeometry(const Base::Matrix4D &rclMat) = 0; + void transformGeometry(const Base::Matrix4D &rclMat) override = 0; //@} /** @name Getting basic geometric entities */ //@{ virtual const Data::ComplexGeoData* getComplexData() const = 0; - virtual Base::BoundBox3d getBoundingBox() const = 0; + Base::BoundBox3d getBoundingBox() const override = 0; //@} }; diff --git a/src/App/PropertyLinks.cpp b/src/App/PropertyLinks.cpp index 6b4507c9fd..e1e213f993 100644 --- a/src/App/PropertyLinks.cpp +++ b/src/App/PropertyLinks.cpp @@ -55,8 +55,7 @@ namespace bp = boost::placeholders; TYPESYSTEM_SOURCE_ABSTRACT(App::PropertyLinkBase , App::Property) static std::unordered_map > _LabelMap; -PropertyLinkBase::PropertyLinkBase() -{} +PropertyLinkBase::PropertyLinkBase() = default; PropertyLinkBase::~PropertyLinkBase() { unregisterLabelReferences(); @@ -574,10 +573,7 @@ TYPESYSTEM_SOURCE(App::PropertyLinkListHidden, App::PropertyLinkList) // Construction/Destruction -PropertyLinkList::PropertyLinkList() -{ - -} +PropertyLinkList::PropertyLinkList() = default; PropertyLinkList::~PropertyLinkList() { @@ -1575,10 +1571,7 @@ TYPESYSTEM_SOURCE(App::PropertyLinkSubListHidden, App::PropertyLinkSubList) // Construction/Destruction -PropertyLinkSubList::PropertyLinkSubList() -{ - -} +PropertyLinkSubList::PropertyLinkSubList() = default; PropertyLinkSubList::~PropertyLinkSubList() { @@ -2658,8 +2651,7 @@ public: :pcDoc(nullptr) {} - ~DocInfo() { - } + ~DocInfo() = default; void deinit() { FC_LOG("deinit " << (pcDoc?pcDoc->getName():filePath())); @@ -3760,8 +3752,7 @@ PropertyXLinkSub::PropertyXLinkSub(bool allowPartial, PropertyLinkBase *parent) } -PropertyXLinkSub::~PropertyXLinkSub() { -} +PropertyXLinkSub::~PropertyXLinkSub() = default; bool PropertyXLinkSub::upgrade(Base::XMLReader &reader, const char *typeName) { if(strcmp(typeName, PropertyLinkSubGlobal::getClassTypeId().getName())==0 || @@ -3811,9 +3802,7 @@ PropertyXLinkSubList::PropertyXLinkSubList() setSyncSubObject(true); } -PropertyXLinkSubList::~PropertyXLinkSubList() -{ -} +PropertyXLinkSubList::~PropertyXLinkSubList() = default; void PropertyXLinkSubList::setSyncSubObject(bool enable) { @@ -4475,13 +4464,9 @@ TYPESYSTEM_SOURCE(App::PropertyXLinkList , App::PropertyXLinkSubList) //************************************************************************** // Construction/Destruction -PropertyXLinkList::PropertyXLinkList() -{ -} +PropertyXLinkList::PropertyXLinkList() = default; -PropertyXLinkList::~PropertyXLinkList() -{ -} +PropertyXLinkList::~PropertyXLinkList() = default; PyObject *PropertyXLinkList::getPyObject() { @@ -4527,8 +4512,7 @@ PropertyXLinkContainer::PropertyXLinkContainer() { _LinkRestored = false; } -PropertyXLinkContainer::~PropertyXLinkContainer() { -} +PropertyXLinkContainer::~PropertyXLinkContainer() = default; void PropertyXLinkContainer::afterRestore() { _DocMap.clear(); diff --git a/src/App/PropertyLinks.h b/src/App/PropertyLinks.h index b8ceaec259..73d1552d90 100644 --- a/src/App/PropertyLinks.h +++ b/src/App/PropertyLinks.h @@ -102,7 +102,7 @@ public: typedef std::pair ShadowSub; PropertyLinkBase(); - virtual ~PropertyLinkBase(); + ~PropertyLinkBase() override; friend class DocInfo; @@ -283,7 +283,7 @@ public: } //@} - virtual bool isSame(const Property &other) const override; + bool isSame(const Property &other) const override; /** Enable/disable temporary holding external object without throwing exception * @@ -546,7 +546,7 @@ public: virtual void setAllowPartial(bool enable) { (void)enable; } protected: - virtual void hasSetValue() override; + void hasSetValue() override; protected: std::bitset<32> _Flags; @@ -582,7 +582,7 @@ public: * A destructor. * A more elaborate description of the destructor. */ - virtual ~PropertyLink(); + ~PropertyLink() override; void resetLink(); @@ -605,29 +605,29 @@ public: return _pcLink ? dynamic_cast<_type>(_pcLink) : 0; } - virtual PyObject *getPyObject() override; - virtual void setPyObject(PyObject *) override; + PyObject *getPyObject() override; + void setPyObject(PyObject *) override; - virtual void Save (Base::Writer &writer) const override; - virtual void Restore(Base::XMLReader &reader) override; + void Save (Base::Writer &writer) const override; + void Restore(Base::XMLReader &reader) override; - virtual Property *Copy() const override; - virtual void Paste(const Property &from) override; + Property *Copy() const override; + void Paste(const Property &from) override; - virtual unsigned int getMemSize () const override { + unsigned int getMemSize () const override { return sizeof(App::DocumentObject *); } - virtual const char* getEditorName() const override + const char* getEditorName() const override { return "Gui::PropertyEditor::PropertyLinkItem"; } - virtual void getLinks(std::vector &objs, + void getLinks(std::vector &objs, bool all=false, std::vector *subs=nullptr, bool newStyle=true) const override; - virtual void breakLink(App::DocumentObject *obj, bool clear) override; + void breakLink(App::DocumentObject *obj, bool clear) override; - virtual bool adjustLink(const std::set &inList) override; + bool adjustLink(const std::set &inList) override; - virtual Property *CopyOnLinkReplace(const App::DocumentObject *parent, + Property *CopyOnLinkReplace(const App::DocumentObject *parent, App::DocumentObject *oldObj, App::DocumentObject *newObj) const override; protected: App::DocumentObject *_pcLink; @@ -665,7 +665,7 @@ class AppExport PropertyLinkListBase: public PropertyLinkBase, public PropertyLi { TYPESYSTEM_HEADER_WITH_OVERRIDE(); public: - virtual void setPyObject(PyObject *obj) override { + void setPyObject(PyObject *obj) override { _setPyObject(obj); } }; @@ -687,10 +687,10 @@ public: * A destructor. * A more elaborate description of the destructor. */ - virtual ~PropertyLinkList(); + ~PropertyLinkList() override; - virtual void setSize(int newSize) override; - virtual void setSize(int newSize, const_reference def) override; + void setSize(int newSize) override; + void setSize(int newSize, const_reference def) override; /** Sets the property */ @@ -698,26 +698,26 @@ public: void set1Value(int idx, DocumentObject * const &value) override; - virtual PyObject *getPyObject() override; + PyObject *getPyObject() override; - virtual void Save(Base::Writer &writer) const override; - virtual void Restore(Base::XMLReader &reader) override; + void Save(Base::Writer &writer) const override; + void Restore(Base::XMLReader &reader) override; - virtual Property *Copy() const override; - virtual void Paste(const Property &from) override; + Property *Copy() const override; + void Paste(const Property &from) override; - virtual unsigned int getMemSize() const override; - virtual const char* getEditorName() const override + unsigned int getMemSize() const override; + const char* getEditorName() const override { return "Gui::PropertyEditor::PropertyLinkListItem"; } - virtual void getLinks(std::vector &objs, + void getLinks(std::vector &objs, bool all=false, std::vector *subs=nullptr, bool newStyle=true) const override; - virtual void breakLink(App::DocumentObject *obj, bool clear) override; + void breakLink(App::DocumentObject *obj, bool clear) override; - virtual bool adjustLink(const std::set &inList) override; + bool adjustLink(const std::set &inList) override; - virtual Property *CopyOnLinkReplace(const App::DocumentObject *parent, + Property *CopyOnLinkReplace(const App::DocumentObject *parent, App::DocumentObject *oldObj, App::DocumentObject *newObj) const override; DocumentObject *find(const std::string &, int *pindex=nullptr) const; @@ -781,10 +781,10 @@ public: * A destructor. * A more elaborate description of the destructor. */ - virtual ~PropertyLinkSub(); + ~PropertyLinkSub() override; - virtual void afterRestore() override; - virtual void onContainerRestored() override; + void afterRestore() override; + void onContainerRestored() override; /** Sets the property */ @@ -821,42 +821,42 @@ public: return _pcLinkSub ? dynamic_cast<_type>(_pcLinkSub) : 0; } - virtual PyObject *getPyObject() override; - virtual void setPyObject(PyObject *) override; + PyObject *getPyObject() override; + void setPyObject(PyObject *) override; - virtual void Save (Base::Writer &writer) const override; - virtual void Restore(Base::XMLReader &reader) override; + void Save (Base::Writer &writer) const override; + void Restore(Base::XMLReader &reader) override; - virtual Property *Copy() const override; - virtual void Paste(const Property &from) override; + Property *Copy() const override; + void Paste(const Property &from) override; - virtual const char* getEditorName() const override + const char* getEditorName() const override { return "Gui::PropertyEditor::PropertyLinkItem"; } /// Return a copy of the property if any changes caused by importing external object - virtual Property *CopyOnImportExternal(const std::map &nameMap) const override; + Property *CopyOnImportExternal(const std::map &nameMap) const override; - virtual Property *CopyOnLabelChange(App::DocumentObject *obj, + Property *CopyOnLabelChange(App::DocumentObject *obj, const std::string &ref, const char *newLabel) const override; - virtual Property *CopyOnLinkReplace(const App::DocumentObject *parent, + Property *CopyOnLinkReplace(const App::DocumentObject *parent, App::DocumentObject *oldObj, App::DocumentObject *newObj) const override; - virtual unsigned int getMemSize () const override { + unsigned int getMemSize () const override { return sizeof(App::DocumentObject *); } - virtual void updateElementReference( + void updateElementReference( DocumentObject *feature,bool reverse=false, bool notify=false) override; - virtual bool referenceChanged() const override; + bool referenceChanged() const override; - virtual void getLinks(std::vector &objs, + void getLinks(std::vector &objs, bool all=false, std::vector *subs=nullptr, bool newStyle=true) const override; - virtual void breakLink(App::DocumentObject *obj, bool clear) override; + void breakLink(App::DocumentObject *obj, bool clear) override; - virtual bool adjustLink(const std::set &inList) override; + bool adjustLink(const std::set &inList) override; void setSyncSubObject(bool enable); protected: @@ -910,10 +910,10 @@ public: * A destructor. * A more elaborate description of the destructor. */ - virtual ~PropertyLinkSubList(); + ~PropertyLinkSubList() override; - virtual void afterRestore() override; - virtual void onContainerRestored() override; + void afterRestore() override; + void onContainerRestored() override; int getSize() const; void setSize(int newSize); @@ -969,41 +969,41 @@ public: void setSubListValues(const std::vector&); std::vector getSubListValues(bool newStyle=false) const; - virtual PyObject *getPyObject() override; - virtual void setPyObject(PyObject *) override; + PyObject *getPyObject() override; + void setPyObject(PyObject *) override; - virtual void Save (Base::Writer &writer) const override; - virtual void Restore(Base::XMLReader &reader) override; + void Save (Base::Writer &writer) const override; + void Restore(Base::XMLReader &reader) override; bool upgrade(Base::XMLReader &reader, const char *typeName); - virtual Property *Copy() const override; - virtual void Paste(const Property &from) override; + Property *Copy() const override; + void Paste(const Property &from) override; - virtual const char* getEditorName() const override + const char* getEditorName() const override { return "Gui::PropertyEditor::PropertyLinkListItem"; } /// Return a copy of the property if any changes caused by importing external object - virtual Property *CopyOnImportExternal(const std::map &nameMap) const override; + Property *CopyOnImportExternal(const std::map &nameMap) const override; - virtual Property *CopyOnLabelChange(App::DocumentObject *obj, + Property *CopyOnLabelChange(App::DocumentObject *obj, const std::string &ref, const char *newLabel) const override; - virtual Property *CopyOnLinkReplace(const App::DocumentObject *parent, + Property *CopyOnLinkReplace(const App::DocumentObject *parent, App::DocumentObject *oldObj, App::DocumentObject *newObj) const override; - virtual unsigned int getMemSize () const override; + unsigned int getMemSize () const override; - virtual void updateElementReference( + void updateElementReference( DocumentObject *feature,bool reverse=false, bool notify=false) override; - virtual bool referenceChanged() const override; + bool referenceChanged() const override; - virtual void getLinks(std::vector &objs, + void getLinks(std::vector &objs, bool all=false, std::vector *subs=nullptr, bool newStyle=true) const override; - virtual void breakLink(App::DocumentObject *obj, bool clear) override; + void breakLink(App::DocumentObject *obj, bool clear) override; - virtual bool adjustLink(const std::set &inList) override; + bool adjustLink(const std::set &inList) override; void setSyncSubObject(bool enable); @@ -1056,12 +1056,12 @@ class AppExport PropertyXLink : public PropertyLinkGlobal public: PropertyXLink(bool allowPartial=false, PropertyLinkBase *parent=nullptr); - virtual ~PropertyXLink(); + ~PropertyXLink() override; PropertyLinkBase *parent() const { return parentProp; } - virtual void afterRestore() override; - virtual void onContainerRestored() override; + void afterRestore() override; + void onContainerRestored() override; void setValue(App::DocumentObject *) override; void setValue(App::DocumentObject *, const char *subname); @@ -1087,25 +1087,25 @@ public: const char *getDocumentPath() const; const char *getObjectName() const; - virtual int checkRestore(std::string *msg=nullptr) const override; + int checkRestore(std::string *msg=nullptr) const override; - virtual void Save (Base::Writer &writer) const override; - virtual void Restore(Base::XMLReader &reader) override; + void Save (Base::Writer &writer) const override; + void Restore(Base::XMLReader &reader) override; - virtual Property *Copy() const override; - virtual void Paste(const Property &from) override; + Property *Copy() const override; + void Paste(const Property &from) override; /// Return a copy of the property if any changes caused by importing external object - virtual Property *CopyOnImportExternal(const std::map &nameMap) const override; + Property *CopyOnImportExternal(const std::map &nameMap) const override; - virtual Property *CopyOnLabelChange(App::DocumentObject *obj, + Property *CopyOnLabelChange(App::DocumentObject *obj, const std::string &ref, const char *newLabel) const override; - virtual Property *CopyOnLinkReplace(const App::DocumentObject *parent, + Property *CopyOnLinkReplace(const App::DocumentObject *parent, App::DocumentObject *oldObj, App::DocumentObject *newObj) const override; - virtual PyObject *getPyObject() override; - virtual void setPyObject(PyObject *) override; + PyObject *getPyObject() override; + void setPyObject(PyObject *) override; friend class DocInfo; @@ -1116,15 +1116,15 @@ public: static std::map > getDocumentInList(App::Document *doc=nullptr); static void restoreDocument(const App::Document &doc); - virtual void updateElementReference( + void updateElementReference( DocumentObject *feature,bool reverse=false, bool notify=false) override; - virtual bool referenceChanged() const override; + bool referenceChanged() const override; - virtual void getLinks(std::vector &objs, + void getLinks(std::vector &objs, bool all=false, std::vector *subs=nullptr, bool newStyle=true) const override; - virtual bool adjustLink(const std::set &inList) override; + bool adjustLink(const std::set &inList) override; const std::vector& getSubValues() const { return _SubList; @@ -1135,7 +1135,7 @@ public: std::vector getSubValues(bool newStyle) const; std::vector getSubValuesStartsWith(const char*, bool newStyle=false) const; - virtual void setAllowPartial(bool enable) override; + void setAllowPartial(bool enable) override; const char *getFilePath() const { return filePath.c_str(); @@ -1153,9 +1153,9 @@ protected: void copyTo(PropertyXLink &other, App::DocumentObject *linked=nullptr, std::vector *subs=nullptr) const; - virtual void aboutToSetValue() override; + void aboutToSetValue() override; - virtual void hasSetValue() override; + void hasSetValue() override; friend class PropertyXLinkSubList; @@ -1180,13 +1180,13 @@ class AppExport PropertyXLinkSub: public PropertyXLink { public: PropertyXLinkSub(bool allowPartial=false, PropertyLinkBase *parent=nullptr); - virtual ~PropertyXLinkSub(); + ~PropertyXLinkSub() override; - virtual bool upgrade(Base::XMLReader &reader, const char *typeName) override; + bool upgrade(Base::XMLReader &reader, const char *typeName) override; - virtual PyObject *getPyObject() override; + PyObject *getPyObject() override; - virtual const char* getEditorName() const override + const char* getEditorName() const override { return "Gui::PropertyEditor::PropertyLinkItem"; } }; @@ -1203,10 +1203,10 @@ class AppExport PropertyXLinkSubList: public PropertyLinkBase public: PropertyXLinkSubList(); - virtual ~PropertyXLinkSubList(); + ~PropertyXLinkSubList() override; - virtual void afterRestore() override; - virtual void onContainerRestored() override; + void afterRestore() override; + void onContainerRestored() override; int getSize() const; @@ -1255,48 +1255,48 @@ public: return _Links; } - virtual PyObject *getPyObject() override; - virtual void setPyObject(PyObject *) override; + PyObject *getPyObject() override; + void setPyObject(PyObject *) override; - virtual void Save (Base::Writer &writer) const override; - virtual void Restore(Base::XMLReader &reader) override; + void Save (Base::Writer &writer) const override; + void Restore(Base::XMLReader &reader) override; - virtual Property *Copy() const override; - virtual void Paste(const Property &from) override; + Property *Copy() const override; + void Paste(const Property &from) override; - virtual const char* getEditorName() const override + const char* getEditorName() const override { return "Gui::PropertyEditor::PropertyLinkListItem"; } - virtual Property *CopyOnImportExternal(const std::map &nameMap) const override; + Property *CopyOnImportExternal(const std::map &nameMap) const override; - virtual Property *CopyOnLabelChange(App::DocumentObject *obj, + Property *CopyOnLabelChange(App::DocumentObject *obj, const std::string &ref, const char *newLabel) const override; - virtual Property *CopyOnLinkReplace(const App::DocumentObject *parent, + Property *CopyOnLinkReplace(const App::DocumentObject *parent, App::DocumentObject *oldObj, App::DocumentObject *newObj) const override; - virtual unsigned int getMemSize () const override; + unsigned int getMemSize () const override; - virtual void updateElementReference( + void updateElementReference( DocumentObject *feature,bool reverse=false, bool notify=false) override; - virtual bool referenceChanged() const override; + bool referenceChanged() const override; - virtual void getLinks(std::vector &objs, + void getLinks(std::vector &objs, bool all=false, std::vector *subs=nullptr, bool newStyle=true) const override; - virtual void breakLink(App::DocumentObject *obj, bool clear) override; + void breakLink(App::DocumentObject *obj, bool clear) override; - virtual bool adjustLink(const std::set &inList) override; + bool adjustLink(const std::set &inList) override; bool upgrade(Base::XMLReader &reader, const char *typeName); - virtual int checkRestore(std::string *msg=nullptr) const override; + int checkRestore(std::string *msg=nullptr) const override; - virtual void setAllowPartial(bool enable) override; + void setAllowPartial(bool enable) override; - virtual void hasSetChildValue(Property &) override; - virtual void aboutToSetChildValue(Property &) override; + void hasSetChildValue(Property &) override; + void aboutToSetChildValue(Property &) override; void setSyncSubObject(bool enable); @@ -1316,10 +1316,10 @@ class AppExport PropertyXLinkList: public PropertyXLinkSubList { public: PropertyXLinkList(); - virtual ~PropertyXLinkList(); + ~PropertyXLinkList() override; - virtual PyObject *getPyObject() override; - virtual void setPyObject(PyObject *) override; + PyObject *getPyObject() override; + void setPyObject(PyObject *) override; }; @@ -1331,20 +1331,20 @@ class AppExport PropertyXLinkContainer : public PropertyLinkBase { TYPESYSTEM_HEADER_WITH_OVERRIDE(); public: PropertyXLinkContainer(); - ~PropertyXLinkContainer(); + ~PropertyXLinkContainer() override; - virtual void afterRestore() override; - virtual int checkRestore(std::string *msg=nullptr) const override; - virtual void Save (Base::Writer &writer) const override; - virtual void Restore(Base::XMLReader &reader) override; - virtual void breakLink(App::DocumentObject *obj, bool clear) override; - virtual void getLinks(std::vector &objs, + void afterRestore() override; + int checkRestore(std::string *msg=nullptr) const override; + void Save (Base::Writer &writer) const override; + void Restore(Base::XMLReader &reader) override; + void breakLink(App::DocumentObject *obj, bool clear) override; + void getLinks(std::vector &objs, bool all=false, std::vector *subs=nullptr, bool newStyle=true) const override; bool isLinkedToDocument(const App::Document &doc) const; protected: - virtual void aboutToSetChildValue(App::Property &prop) override; + void aboutToSetChildValue(App::Property &prop) override; virtual PropertyXLink *createXLink(); virtual void onBreakLink(App::DocumentObject *obj); virtual void onAddDep(App::DocumentObject *) {} diff --git a/src/App/PropertyPythonObject.cpp b/src/App/PropertyPythonObject.cpp index dc80057849..604368d225 100644 --- a/src/App/PropertyPythonObject.cpp +++ b/src/App/PropertyPythonObject.cpp @@ -41,9 +41,7 @@ using namespace App; TYPESYSTEM_SOURCE(App::PropertyPythonObject , App::Property) -PropertyPythonObject::PropertyPythonObject() -{ -} +PropertyPythonObject::PropertyPythonObject() = default; PropertyPythonObject::~PropertyPythonObject() { diff --git a/src/App/PropertyPythonObject.h b/src/App/PropertyPythonObject.h index 96cd5c4d48..a5569bcb43 100644 --- a/src/App/PropertyPythonObject.h +++ b/src/App/PropertyPythonObject.h @@ -48,24 +48,24 @@ class AppExport PropertyPythonObject : public Property public: PropertyPythonObject(); - virtual ~PropertyPythonObject(); + ~PropertyPythonObject() override; void setValue(Py::Object); Py::Object getValue() const; - virtual PyObject *getPyObject(); - virtual void setPyObject(PyObject *); + PyObject *getPyObject() override; + void setPyObject(PyObject *) override; /** Use Python's pickle module to save the object */ - virtual void Save (Base::Writer &writer) const; + void Save (Base::Writer &writer) const override; /** Use Python's pickle module to restore the object */ - virtual void Restore(Base::XMLReader &reader); - virtual void SaveDocFile (Base::Writer &writer) const; - virtual void RestoreDocFile(Base::Reader &reader); + void Restore(Base::XMLReader &reader) override; + void SaveDocFile (Base::Writer &writer) const override; + void RestoreDocFile(Base::Reader &reader) override; - virtual unsigned int getMemSize () const; - virtual Property *Copy() const; - virtual void Paste(const Property &from); + unsigned int getMemSize () const override; + Property *Copy() const override; + void Paste(const Property &from) override; std::string toString() const; void fromString(const std::string&); diff --git a/src/App/PropertyStandard.cpp b/src/App/PropertyStandard.cpp index acc939c998..1d56d2d130 100644 --- a/src/App/PropertyStandard.cpp +++ b/src/App/PropertyStandard.cpp @@ -67,10 +67,7 @@ PropertyInteger::PropertyInteger() } -PropertyInteger::~PropertyInteger() -{ - -} +PropertyInteger::~PropertyInteger() = default; //************************************************************************** // Base class implementer @@ -163,15 +160,9 @@ TYPESYSTEM_SOURCE(App::PropertyPath , App::Property) //************************************************************************** // Construction/Destruction -PropertyPath::PropertyPath() -{ +PropertyPath::PropertyPath() = default; -} - -PropertyPath::~PropertyPath() -{ - -} +PropertyPath::~PropertyPath() = default; //************************************************************************** @@ -291,10 +282,7 @@ PropertyEnumeration::PropertyEnumeration(const App::Enumeration &e) _enum = e; } -PropertyEnumeration::~PropertyEnumeration() -{ - -} +PropertyEnumeration::~PropertyEnumeration() = default; void PropertyEnumeration::setEnums(const char **plEnums) { @@ -729,9 +717,7 @@ PropertyPercent::PropertyPercent() _ConstStruct = &percent; } -PropertyPercent::~PropertyPercent() -{ -} +PropertyPercent::~PropertyPercent() = default; //************************************************************************** //************************************************************************** @@ -744,15 +730,9 @@ TYPESYSTEM_SOURCE(App::PropertyIntegerList , App::PropertyLists) // Construction/Destruction -PropertyIntegerList::PropertyIntegerList() -{ +PropertyIntegerList::PropertyIntegerList() = default; -} - -PropertyIntegerList::~PropertyIntegerList() -{ - -} +PropertyIntegerList::~PropertyIntegerList() = default; //************************************************************************** // Base class implementer @@ -833,15 +813,9 @@ TYPESYSTEM_SOURCE(App::PropertyIntegerSet , App::Property) // Construction/Destruction -PropertyIntegerSet::PropertyIntegerSet() -{ +PropertyIntegerSet::PropertyIntegerSet() = default; -} - -PropertyIntegerSet::~PropertyIntegerSet() -{ - -} +PropertyIntegerSet::~PropertyIntegerSet() = default; //************************************************************************** @@ -965,10 +939,7 @@ PropertyFloat::PropertyFloat() _dValue = 0.0; } -PropertyFloat::~PropertyFloat() -{ - -} +PropertyFloat::~PropertyFloat() = default; //************************************************************************** // Base class implementer @@ -1204,10 +1175,7 @@ PropertyPrecision::PropertyPrecision() setConstraints(&PrecisionStandard); } -PropertyPrecision::~PropertyPrecision() -{ - -} +PropertyPrecision::~PropertyPrecision() = default; //************************************************************************** @@ -1220,15 +1188,9 @@ TYPESYSTEM_SOURCE(App::PropertyFloatList , App::PropertyLists) // Construction/Destruction -PropertyFloatList::PropertyFloatList() -{ +PropertyFloatList::PropertyFloatList() = default; -} - -PropertyFloatList::~PropertyFloatList() -{ - -} +PropertyFloatList::~PropertyFloatList() = default; //************************************************************************** // Base class implementer @@ -1343,15 +1305,9 @@ unsigned int PropertyFloatList::getMemSize () const TYPESYSTEM_SOURCE(App::PropertyString , App::Property) -PropertyString::PropertyString() -{ +PropertyString::PropertyString() = default; -} - -PropertyString::~PropertyString() -{ - -} +PropertyString::~PropertyString() = default; void PropertyString::setValue(const char* newLabel) { @@ -1599,15 +1555,9 @@ const boost::any PropertyString::getPathValue(const ObjectIdentifier &path) cons TYPESYSTEM_SOURCE(App::PropertyUUID , App::Property) -PropertyUUID::PropertyUUID() -{ +PropertyUUID::PropertyUUID() = default; -} - -PropertyUUID::~PropertyUUID() -{ - -} +PropertyUUID::~PropertyUUID() = default; void PropertyUUID::setValue(const Base::Uuid &id) { @@ -1709,15 +1659,9 @@ unsigned int PropertyUUID::getMemSize () const TYPESYSTEM_SOURCE(App::PropertyFont , App::PropertyString) -PropertyFont::PropertyFont() -{ +PropertyFont::PropertyFont() = default; -} - -PropertyFont::~PropertyFont() -{ - -} +PropertyFont::~PropertyFont() = default; //************************************************************************** // PropertyStringList @@ -1725,15 +1669,9 @@ PropertyFont::~PropertyFont() TYPESYSTEM_SOURCE(App::PropertyStringList , App::PropertyLists) -PropertyStringList::PropertyStringList() -{ +PropertyStringList::PropertyStringList() = default; -} - -PropertyStringList::~PropertyStringList() -{ - -} +PropertyStringList::~PropertyStringList() = default; //************************************************************************** // Base class implementer @@ -1836,15 +1774,9 @@ void PropertyStringList::Paste(const Property &from) TYPESYSTEM_SOURCE(App::PropertyMap , App::Property) -PropertyMap::PropertyMap() -{ +PropertyMap::PropertyMap() = default; -} - -PropertyMap::~PropertyMap() -{ - -} +PropertyMap::~PropertyMap() = default; //************************************************************************** // Base class implementer @@ -2019,10 +1951,7 @@ PropertyBool::PropertyBool() _lValue = false; } -PropertyBool::~PropertyBool() -{ - -} +PropertyBool::~PropertyBool() = default; //************************************************************************** // Setter/getter for the property @@ -2128,15 +2057,9 @@ TYPESYSTEM_SOURCE(App::PropertyBoolList , App::PropertyLists) // Construction/Destruction -PropertyBoolList::PropertyBoolList() -{ +PropertyBoolList::PropertyBoolList() = default; -} - -PropertyBoolList::~PropertyBoolList() -{ - -} +PropertyBoolList::~PropertyBoolList() = default; //************************************************************************** // Base class implementer @@ -2226,15 +2149,9 @@ TYPESYSTEM_SOURCE(App::PropertyColor , App::Property) //************************************************************************** // Construction/Destruction -PropertyColor::PropertyColor() -{ +PropertyColor::PropertyColor() = default; -} - -PropertyColor::~PropertyColor() -{ - -} +PropertyColor::~PropertyColor() = default; //************************************************************************** // Base class implementer @@ -2375,15 +2292,9 @@ TYPESYSTEM_SOURCE(App::PropertyColorList , App::PropertyLists) //************************************************************************** // Construction/Destruction -PropertyColorList::PropertyColorList() -{ +PropertyColorList::PropertyColorList() = default; -} - -PropertyColorList::~PropertyColorList() -{ - -} +PropertyColorList::~PropertyColorList() = default; //************************************************************************** // Base class implementer @@ -2485,15 +2396,9 @@ unsigned int PropertyColorList::getMemSize () const TYPESYSTEM_SOURCE(App::PropertyMaterial , App::Property) -PropertyMaterial::PropertyMaterial() -{ +PropertyMaterial::PropertyMaterial() = default; -} - -PropertyMaterial::~PropertyMaterial() -{ - -} +PropertyMaterial::~PropertyMaterial() = default; void PropertyMaterial::setValue(const Material &mat) { @@ -2623,15 +2528,9 @@ TYPESYSTEM_SOURCE(App::PropertyMaterialList, App::PropertyLists) //************************************************************************** // Construction/Destruction -PropertyMaterialList::PropertyMaterialList() -{ +PropertyMaterialList::PropertyMaterialList() = default; -} - -PropertyMaterialList::~PropertyMaterialList() -{ - -} +PropertyMaterialList::~PropertyMaterialList() = default; //************************************************************************** // Base class implementer diff --git a/src/App/PropertyStandard.h b/src/App/PropertyStandard.h index ac9c1c6b19..96d1270792 100644 --- a/src/App/PropertyStandard.h +++ b/src/App/PropertyStandard.h @@ -54,7 +54,7 @@ class AppExport PropertyInteger: public Property public: PropertyInteger(); - virtual ~PropertyInteger(); + ~PropertyInteger() override; /** Sets the property */ @@ -63,23 +63,23 @@ public: /** This method returns a string representation of the property */ long getValue() const; - virtual const char* getEditorName() const { return "Gui::PropertyEditor::PropertyIntegerItem"; } + const char* getEditorName() const override { return "Gui::PropertyEditor::PropertyIntegerItem"; } - virtual PyObject *getPyObject(); - virtual void setPyObject(PyObject *); + PyObject *getPyObject() override; + void setPyObject(PyObject *) override; - virtual void Save (Base::Writer &writer) const; - virtual void Restore(Base::XMLReader &reader); + void Save (Base::Writer &writer) const override; + void Restore(Base::XMLReader &reader) override; - virtual Property *Copy() const; - virtual void Paste(const Property &from); + Property *Copy() const override; + void Paste(const Property &from) override; - virtual unsigned int getMemSize () const{return sizeof(long);} + unsigned int getMemSize () const override{return sizeof(long);} - virtual void setPathValue(const App::ObjectIdentifier & path, const boost::any & value); - virtual const boost::any getPathValue(const App::ObjectIdentifier & /*path*/) const { return _lValue; } + void setPathValue(const App::ObjectIdentifier & path, const boost::any & value) override; + const boost::any getPathValue(const App::ObjectIdentifier & /*path*/) const override { return _lValue; } - virtual bool isSame(const Property &other) const { + bool isSame(const Property &other) const override { if (&other == this) return true; return getTypeId() == other.getTypeId() @@ -100,7 +100,7 @@ class AppExport PropertyPath: public Property public: PropertyPath(); - virtual ~PropertyPath(); + ~PropertyPath() override; /** Sets the property */ @@ -114,20 +114,20 @@ public: */ const boost::filesystem::path &getValue() const; - virtual const char* getEditorName() const { return "Gui::PropertyEditor::PropertyPathItem"; } + const char* getEditorName() const override { return "Gui::PropertyEditor::PropertyPathItem"; } - virtual PyObject *getPyObject(); - virtual void setPyObject(PyObject *); + PyObject *getPyObject() override; + void setPyObject(PyObject *) override; - virtual void Save (Base::Writer &writer) const; - virtual void Restore(Base::XMLReader &reader); + void Save (Base::Writer &writer) const override; + void Restore(Base::XMLReader &reader) override; - virtual Property *Copy() const; - virtual void Paste(const Property &from); + Property *Copy() const override; + void Paste(const Property &from) override; - virtual unsigned int getMemSize () const; + unsigned int getMemSize () const override; - virtual bool isSame(const Property &other) const { + bool isSame(const Property &other) const override { if (&other == this) return true; return getTypeId() == other.getTypeId() @@ -151,7 +151,7 @@ public: PropertyEnumeration(const Enumeration &e); /// destructor - virtual ~PropertyEnumeration(); + ~PropertyEnumeration() override; /// Enumeration methods /*! @@ -212,24 +212,24 @@ public: bool isValid() const; //@} - const char* getEditorName() const { return _editorTypeName.c_str(); } + const char* getEditorName() const override { return _editorTypeName.c_str(); } void setEditorName(const char* name) { _editorTypeName = name; } - virtual PyObject * getPyObject(); - virtual void setPyObject(PyObject *); + PyObject * getPyObject() override; + void setPyObject(PyObject *) override; - virtual void Save(Base::Writer &writer) const; - virtual void Restore(Base::XMLReader &reader); + void Save(Base::Writer &writer) const override; + void Restore(Base::XMLReader &reader) override; - virtual Property * Copy() const; - virtual void Paste(const Property &from); + Property * Copy() const override; + void Paste(const Property &from) override; - virtual void setPathValue(const App::ObjectIdentifier & path, const boost::any & value); + void setPathValue(const App::ObjectIdentifier & path, const boost::any & value) override; virtual bool setPyPathValue(const App::ObjectIdentifier & path, const Py::Object &value); - virtual const boost::any getPathValue(const App::ObjectIdentifier & /*path*/) const; - virtual bool getPyPathValue(const ObjectIdentifier &path, Py::Object &r) const; + const boost::any getPathValue(const App::ObjectIdentifier & /*path*/) const override; + bool getPyPathValue(const ObjectIdentifier &path, Py::Object &r) const override; - virtual bool isSame(const Property &other) const { + bool isSame(const Property &other) const override { if (&other == this) return true; return getTypeId() == other.getTypeId() @@ -256,7 +256,7 @@ public: PropertyIntegerConstraint(); /// destructor - virtual ~PropertyIntegerConstraint(); + ~PropertyIntegerConstraint() override; /// Constraint methods //@{ @@ -277,9 +277,7 @@ public: , candelete(false) { } - ~Constraints() - { - } + ~Constraints() = default; void setDeletable(bool on) { candelete = on; @@ -308,8 +306,8 @@ public: long getMaximum() const; long getStepSize() const; - virtual const char* getEditorName() const { return "Gui::PropertyEditor::PropertyIntegerConstraintItem"; } - virtual void setPyObject(PyObject *); + const char* getEditorName() const override { return "Gui::PropertyEditor::PropertyIntegerConstraintItem"; } + void setPyObject(PyObject *) override; protected: const Constraints* _ConstStruct; @@ -329,7 +327,7 @@ public: PropertyPercent(); /// destructor - virtual ~PropertyPercent(); + ~PropertyPercent() override; }; /** Integer list properties @@ -351,19 +349,19 @@ public: * A destructor. * A more elaborate description of the destructor. */ - virtual ~PropertyIntegerList(); + ~PropertyIntegerList() override; - virtual const char* getEditorName() const override + const char* getEditorName() const override { return "Gui::PropertyEditor::PropertyIntegerListItem"; } - virtual PyObject *getPyObject() override; + PyObject *getPyObject() override; - virtual void Save (Base::Writer &writer) const override; - virtual void Restore(Base::XMLReader &reader) override; + void Save (Base::Writer &writer) const override; + void Restore(Base::XMLReader &reader) override; - virtual Property *Copy() const override; - virtual void Paste(const Property &from) override; - virtual unsigned int getMemSize () const override; + Property *Copy() const override; + void Paste(const Property &from) override; + unsigned int getMemSize () const override; protected: long getPyValue(PyObject *item) const override; @@ -388,7 +386,7 @@ public: * A destructor. * A more elaborate description of the destructor. */ - virtual ~PropertyIntegerSet(); + ~PropertyIntegerSet() override; /** Sets the property */ @@ -400,17 +398,17 @@ public: const std::set &getValues() const{return _lValueSet;} - virtual PyObject *getPyObject(); - virtual void setPyObject(PyObject *); + PyObject *getPyObject() override; + void setPyObject(PyObject *) override; - virtual void Save (Base::Writer &writer) const; - virtual void Restore(Base::XMLReader &reader); + void Save (Base::Writer &writer) const override; + void Restore(Base::XMLReader &reader) override; - virtual Property *Copy() const; - virtual void Paste(const Property &from); - virtual unsigned int getMemSize () const; + Property *Copy() const override; + void Paste(const Property &from) override; + unsigned int getMemSize () const override; - virtual bool isSame(const Property &other) const { + bool isSame(const Property &other) const override { if (&other == this) return true; return getTypeId() == other.getTypeId() @@ -440,7 +438,7 @@ public: * A destructor. * A more elaborate description of the destructor. */ - virtual ~PropertyMap(); + ~PropertyMap() override; virtual int getSize() const; @@ -459,18 +457,18 @@ public: //virtual const char* getEditorName(void) const { return "Gui::PropertyEditor::PropertyStringListItem"; } - virtual PyObject *getPyObject(); - virtual void setPyObject(PyObject *); + PyObject *getPyObject() override; + void setPyObject(PyObject *) override; - virtual void Save (Base::Writer &writer) const; - virtual void Restore(Base::XMLReader &reader); + void Save (Base::Writer &writer) const override; + void Restore(Base::XMLReader &reader) override; - virtual Property *Copy() const; - virtual void Paste(const Property &from); + Property *Copy() const override; + void Paste(const Property &from) override; - virtual unsigned int getMemSize () const; + unsigned int getMemSize () const override; - virtual bool isSame(const Property &other) const { + bool isSame(const Property &other) const override { if (&other == this) return true; return getTypeId() == other.getTypeId() @@ -504,29 +502,29 @@ public: * A destructor. * A more elaborate description of the destructor. */ - virtual ~PropertyFloat(); + ~PropertyFloat() override; void setValue(double lValue); double getValue() const; - virtual const char* getEditorName() const { return "Gui::PropertyEditor::PropertyFloatItem"; } + const char* getEditorName() const override { return "Gui::PropertyEditor::PropertyFloatItem"; } - virtual PyObject *getPyObject(); - virtual void setPyObject(PyObject *); + PyObject *getPyObject() override; + void setPyObject(PyObject *) override; - virtual void Save (Base::Writer &writer) const; - virtual void Restore(Base::XMLReader &reader); + void Save (Base::Writer &writer) const override; + void Restore(Base::XMLReader &reader) override; - virtual Property *Copy() const; - virtual void Paste(const Property &from); + Property *Copy() const override; + void Paste(const Property &from) override; - virtual unsigned int getMemSize () const{return sizeof(double);} + unsigned int getMemSize () const override{return sizeof(double);} - void setPathValue(const App::ObjectIdentifier &path, const boost::any &value); - const boost::any getPathValue(const App::ObjectIdentifier &path) const; + void setPathValue(const App::ObjectIdentifier &path, const boost::any &value) override; + const boost::any getPathValue(const App::ObjectIdentifier &path) const override; - virtual bool isSame(const Property &other) const { + bool isSame(const Property &other) const override { if (&other == this) return true; return getTypeId() == other.getTypeId() @@ -558,7 +556,7 @@ public: * A destructor. * A more elaborate description of the destructor. */ - virtual ~PropertyFloatConstraint(); + ~PropertyFloatConstraint() override; /// Constraint methods @@ -580,9 +578,7 @@ public: , candelete(false) { } - ~Constraints() - { - } + ~Constraints() = default; void setDeletable(bool on) { candelete = on; @@ -611,10 +607,10 @@ public: double getMaximum() const; double getStepSize() const; - virtual const char* getEditorName() const + const char* getEditorName() const override { return "Gui::PropertyEditor::PropertyFloatConstraintItem"; } - virtual void setPyObject(PyObject *); + void setPyObject(PyObject *) override; protected: const Constraints* _ConstStruct; @@ -631,8 +627,8 @@ class AppExport PropertyPrecision: public PropertyFloatConstraint TYPESYSTEM_HEADER(); public: PropertyPrecision(); - virtual ~PropertyPrecision(); - virtual const char* getEditorName() const + ~PropertyPrecision() override; + const char* getEditorName() const override { return "Gui::PropertyEditor::PropertyPrecisionItem"; } }; @@ -653,22 +649,22 @@ public: * A destructor. * A more elaborate description of the destructor. */ - virtual ~PropertyFloatList(); + ~PropertyFloatList() override; - virtual const char* getEditorName() const override + const char* getEditorName() const override { return "Gui::PropertyEditor::PropertyFloatListItem"; } - virtual PyObject *getPyObject() override; + PyObject *getPyObject() override; - virtual void Save (Base::Writer &writer) const override; - virtual void Restore(Base::XMLReader &reader) override; + void Save (Base::Writer &writer) const override; + void Restore(Base::XMLReader &reader) override; - virtual void SaveDocFile (Base::Writer &writer) const override; - virtual void RestoreDocFile(Base::Reader &reader) override; + void SaveDocFile (Base::Writer &writer) const override; + void RestoreDocFile(Base::Reader &reader) override; - virtual Property *Copy() const override; - virtual void Paste(const Property &from) override; - virtual unsigned int getMemSize () const override; + Property *Copy() const override; + void Paste(const Property &from) override; + unsigned int getMemSize () const override; protected: double getPyValue(PyObject *item) const override; @@ -694,7 +690,7 @@ public: * A destructor. * A more elaborate description of the destructor. */ - virtual ~PropertyString(); + ~PropertyString() override; virtual void setValue(const char* sString); void setValue(const std::string &sString); @@ -703,21 +699,21 @@ public: { return _cValue; } bool isEmpty(){return _cValue.empty();} - virtual const char* getEditorName() const { return "Gui::PropertyEditor::PropertyStringItem"; } - virtual PyObject *getPyObject(); - virtual void setPyObject(PyObject *); + const char* getEditorName() const override { return "Gui::PropertyEditor::PropertyStringItem"; } + PyObject *getPyObject() override; + void setPyObject(PyObject *) override; - virtual void Save (Base::Writer &writer) const; - virtual void Restore(Base::XMLReader &reader); + void Save (Base::Writer &writer) const override; + void Restore(Base::XMLReader &reader) override; - virtual Property *Copy() const; - virtual void Paste(const Property &from); - virtual unsigned int getMemSize () const; + Property *Copy() const override; + void Paste(const Property &from) override; + unsigned int getMemSize () const override; - void setPathValue(const App::ObjectIdentifier &path, const boost::any &value); - const boost::any getPathValue(const App::ObjectIdentifier &path) const; + void setPathValue(const App::ObjectIdentifier &path, const boost::any &value) override; + const boost::any getPathValue(const App::ObjectIdentifier &path) const override; - virtual bool isSame(const Property &other) const { + bool isSame(const Property &other) const override { if (&other == this) return true; return getTypeId() == other.getTypeId() @@ -747,7 +743,7 @@ public: * A destructor. * A more elaborate description of the destructor. */ - virtual ~PropertyUUID(); + ~PropertyUUID() override; void setValue(const Base::Uuid &); @@ -757,17 +753,17 @@ public: const Base::Uuid& getValue() const; //virtual const char* getEditorName(void) const { return "Gui::PropertyEditor::PropertyStringItem"; } - virtual PyObject *getPyObject(); - virtual void setPyObject(PyObject *); + PyObject *getPyObject() override; + void setPyObject(PyObject *) override; - virtual void Save (Base::Writer &writer) const; - virtual void Restore(Base::XMLReader &reader); + void Save (Base::Writer &writer) const override; + void Restore(Base::XMLReader &reader) override; - virtual Property *Copy() const; - virtual void Paste(const Property &from); - virtual unsigned int getMemSize () const; + Property *Copy() const override; + void Paste(const Property &from) override; + unsigned int getMemSize () const override; - virtual bool isSame(const Property &other) const { + bool isSame(const Property &other) const override { if (&other == this) return true; return getTypeId() == other.getTypeId() @@ -787,11 +783,11 @@ class AppExport PropertyFont : public PropertyString public: PropertyFont(); - virtual ~PropertyFont(); - virtual const char* getEditorName() const + ~PropertyFont() override; + const char* getEditorName() const override { return "Gui::PropertyEditor::PropertyFontItem"; } - virtual bool isSame(const Property &other) const { + bool isSame(const Property &other) const override { if (&other == this) return true; return getTypeId() == other.getTypeId() @@ -816,23 +812,23 @@ public: * A destructor. * A more elaborate description of the destructor. */ - virtual ~PropertyStringList(); + ~PropertyStringList() override; void setValues(const std::list&); using inherited::setValues; - virtual const char* getEditorName() const override + const char* getEditorName() const override { return "Gui::PropertyEditor::PropertyStringListItem"; } - virtual PyObject *getPyObject() override; + PyObject *getPyObject() override; - virtual void Save (Base::Writer &writer) const override; - virtual void Restore(Base::XMLReader &reader) override; + void Save (Base::Writer &writer) const override; + void Restore(Base::XMLReader &reader) override; - virtual Property *Copy() const override; - virtual void Paste(const Property &from) override; + Property *Copy() const override; + void Paste(const Property &from) override; - virtual unsigned int getMemSize () const override; + unsigned int getMemSize () const override; protected: std::string getPyValue(PyObject *item) const override; @@ -857,28 +853,28 @@ public: * A destructor. * A more elaborate description of the destructor. */ - virtual ~PropertyBool(); + ~PropertyBool() override; void setValue(bool lValue); bool getValue() const; - virtual const char* getEditorName() const { return "Gui::PropertyEditor::PropertyBoolItem"; } + const char* getEditorName() const override { return "Gui::PropertyEditor::PropertyBoolItem"; } - virtual PyObject *getPyObject(); - virtual void setPyObject(PyObject *); + PyObject *getPyObject() override; + void setPyObject(PyObject *) override; - virtual void Save (Base::Writer &writer) const; - virtual void Restore(Base::XMLReader &reader); + void Save (Base::Writer &writer) const override; + void Restore(Base::XMLReader &reader) override; - virtual Property *Copy() const; - virtual void Paste(const Property &from); + Property *Copy() const override; + void Paste(const Property &from) override; - virtual unsigned int getMemSize () const{return sizeof(bool);} + unsigned int getMemSize () const override{return sizeof(bool);} - void setPathValue(const App::ObjectIdentifier &path, const boost::any &value); - const boost::any getPathValue(const App::ObjectIdentifier &path) const; + void setPathValue(const App::ObjectIdentifier &path, const boost::any &value) override; + const boost::any getPathValue(const App::ObjectIdentifier &path) const override; - virtual bool isSame(const Property &other) const { + bool isSame(const Property &other) const override { if (&other == this) return true; return getTypeId() == other.getTypeId() @@ -899,17 +895,17 @@ class AppExport PropertyBoolList : public PropertyListsT getObject() const { return _pObject; diff --git a/src/App/PropertyUnits.h b/src/App/PropertyUnits.h index 79bad26f50..67daa40006 100644 --- a/src/App/PropertyUnits.h +++ b/src/App/PropertyUnits.h @@ -45,15 +45,15 @@ class AppExport PropertyQuantity : public PropertyFloat TYPESYSTEM_HEADER(); public: - PropertyQuantity(){} - virtual ~PropertyQuantity(){} + PropertyQuantity() = default; + ~PropertyQuantity() override = default; Base::Quantity getQuantityValue() const; - virtual const char* getEditorName() const; + const char* getEditorName() const override; - virtual PyObject *getPyObject(); - virtual void setPyObject(PyObject *); + PyObject *getPyObject() override; + void setPyObject(PyObject *) override; void setUnit(const Base::Unit &u) {_Unit = u;} const Base::Unit &getUnit() const {return _Unit;} @@ -61,10 +61,10 @@ public: void setValue(double lValue) { PropertyFloat::setValue(lValue); } double getValue() const { return PropertyFloat::getValue(); } - virtual void setPathValue(const App::ObjectIdentifier &path, const boost::any &value); - virtual const boost::any getPathValue(const App::ObjectIdentifier &path) const; + void setPathValue(const App::ObjectIdentifier &path, const boost::any &value) override; + const boost::any getPathValue(const App::ObjectIdentifier &path) const override; - virtual bool isSame(const Property &other) const { + bool isSame(const Property &other) const override { if (&other == this) return true; return getTypeId() == other.getTypeId() @@ -86,7 +86,7 @@ class AppExport PropertyQuantityConstraint : public PropertyQuantity public: PropertyQuantityConstraint():_ConstStruct(nullptr){} - virtual ~PropertyQuantityConstraint(){} + ~PropertyQuantityConstraint() override = default; /// Constraint methods //@{ @@ -111,8 +111,8 @@ public: double getMaximum() const; double getStepSize() const; - virtual const char* getEditorName() const; - virtual void setPyObject(PyObject *); + const char* getEditorName() const override; + void setPyObject(PyObject *) override; protected: @@ -129,7 +129,7 @@ class AppExport PropertyAcceleration: public PropertyQuantity public: PropertyAcceleration(); - virtual ~PropertyAcceleration() {} + ~PropertyAcceleration() override = default; }; /** Angle property @@ -142,8 +142,8 @@ class AppExport PropertyAngle: public PropertyQuantityConstraint public: PropertyAngle(); - virtual ~PropertyAngle() {} - virtual const char *getEditorName() const { return "Gui::PropertyEditor::PropertyAngleItem"; } + ~PropertyAngle() override = default; + const char *getEditorName() const override { return "Gui::PropertyEditor::PropertyAngleItem"; } }; /** Area property @@ -156,7 +156,7 @@ class AppExport PropertyArea: public PropertyQuantityConstraint public: PropertyArea(); - virtual ~PropertyArea() {} + ~PropertyArea() override = default; }; /** Distance property @@ -169,7 +169,7 @@ class AppExport PropertyDistance: public PropertyQuantity public: PropertyDistance(); - virtual ~PropertyDistance() {} + ~PropertyDistance() override = default; }; /** ElectricPotential property @@ -182,7 +182,7 @@ class AppExport PropertyElectricPotential: public PropertyQuantity public: PropertyElectricPotential(); - virtual ~PropertyElectricPotential() {} + ~PropertyElectricPotential() override = default; }; /** Frequency property @@ -195,7 +195,7 @@ class AppExport PropertyFrequency: public PropertyQuantity public: PropertyFrequency(); - virtual ~PropertyFrequency() {} + ~PropertyFrequency() override = default; }; /** Force property @@ -208,7 +208,7 @@ class AppExport PropertyForce: public PropertyQuantity public: PropertyForce(); - virtual ~PropertyForce() {} + ~PropertyForce() override = default; }; /** Length property @@ -221,7 +221,7 @@ class AppExport PropertyLength: public PropertyQuantityConstraint public: PropertyLength(); - virtual ~PropertyLength() {} + ~PropertyLength() override = default; }; /** Pressure property @@ -234,7 +234,7 @@ class AppExport PropertyPressure: public PropertyQuantity public: PropertyPressure(); - virtual ~PropertyPressure() {} + ~PropertyPressure() override = default; }; /** Speed property @@ -247,7 +247,7 @@ class AppExport PropertySpeed: public PropertyQuantity public: PropertySpeed(); - virtual ~PropertySpeed() {} + ~PropertySpeed() override = default; }; /** Stiffness property @@ -260,7 +260,7 @@ class AppExport PropertyStiffness: public PropertyQuantity public: PropertyStiffness(); - virtual ~PropertyStiffness() {} + ~PropertyStiffness() override = default; }; /** VacuumPermittivity property @@ -273,7 +273,7 @@ class AppExport PropertyVacuumPermittivity: public PropertyQuantity public: PropertyVacuumPermittivity(); - virtual ~PropertyVacuumPermittivity() {} + ~PropertyVacuumPermittivity() override = default; }; /** Volume property @@ -286,7 +286,7 @@ class AppExport PropertyVolume: public PropertyQuantityConstraint public: PropertyVolume(); - virtual ~PropertyVolume() {} + ~PropertyVolume() override = default; }; }// namespace App diff --git a/src/App/TextDocument.h b/src/App/TextDocument.h index b9abdf44ed..1cd7a26a1f 100644 --- a/src/App/TextDocument.h +++ b/src/App/TextDocument.h @@ -40,10 +40,10 @@ public: PropertyString Text; TextDocument(); - ~TextDocument() {} + ~TextDocument() override = default; - void onChanged(const Property* prop); - const char* getViewProviderName() const; + void onChanged(const Property* prop) override; + const char* getViewProviderName() const override; boost::signals2::connection connectText(const TextSlot &sub); boost::signals2::connection connectLabel(const TextSlot &sub); diff --git a/src/App/TransactionalObject.cpp b/src/App/TransactionalObject.cpp index d1b8fb77f7..2e4bf944e2 100644 --- a/src/App/TransactionalObject.cpp +++ b/src/App/TransactionalObject.cpp @@ -32,13 +32,9 @@ using namespace App; PROPERTY_SOURCE_ABSTRACT(App::TransactionalObject, App::ExtensionContainer) -TransactionalObject::TransactionalObject() -{ -} +TransactionalObject::TransactionalObject() = default; -TransactionalObject::~TransactionalObject() -{ -} +TransactionalObject::~TransactionalObject() = default; bool TransactionalObject::isAttachedToDocument() const { diff --git a/src/App/TransactionalObject.h b/src/App/TransactionalObject.h index d123aad7bd..4d31b87450 100644 --- a/src/App/TransactionalObject.h +++ b/src/App/TransactionalObject.h @@ -41,7 +41,7 @@ class AppExport TransactionalObject : public App::ExtensionContainer public: /// Constructor TransactionalObject(); - virtual ~TransactionalObject(); + ~TransactionalObject() override; virtual bool isAttachedToDocument() const; virtual const char* detachFromDocument(); protected: diff --git a/src/App/Transactions.cpp b/src/App/Transactions.cpp index 2883774fb0..dc07e9ea05 100644 --- a/src/App/Transactions.cpp +++ b/src/App/Transactions.cpp @@ -433,17 +433,13 @@ TYPESYSTEM_SOURCE_ABSTRACT(App::TransactionDocumentObject, App::TransactionObjec * A constructor. * A more elaborate description of the constructor. */ -TransactionDocumentObject::TransactionDocumentObject() -{ -} +TransactionDocumentObject::TransactionDocumentObject() = default; /** * A destructor. * A more elaborate description of the destructor. */ -TransactionDocumentObject::~TransactionDocumentObject() -{ -} +TransactionDocumentObject::~TransactionDocumentObject() = default; void TransactionDocumentObject::applyDel(Document &Doc, TransactionalObject *pcObj) { diff --git a/src/App/Transactions.h b/src/App/Transactions.h index 2d696f714a..aa09863504 100644 --- a/src/App/Transactions.h +++ b/src/App/Transactions.h @@ -57,7 +57,7 @@ public: */ Transaction(int id = 0); /// Construction - virtual ~Transaction(); + ~Transaction() override; /// apply the content to the document void apply(Document &Doc,bool forward); @@ -65,10 +65,10 @@ public: // the utf-8 name of the transaction std::string Name; - virtual unsigned int getMemSize () const; - virtual void Save (Base::Writer &writer) const; + unsigned int getMemSize () const override; + void Save (Base::Writer &writer) const override; /// This method is used to restore properties from an XML document. - virtual void Restore(Base::XMLReader &reader); + void Restore(Base::XMLReader &reader) override; /// Return the transaction ID int getID() const; @@ -111,7 +111,7 @@ public: /// Construction TransactionObject(); /// Destruction - virtual ~TransactionObject(); + ~TransactionObject() override; virtual void applyNew(Document &Doc, TransactionalObject *pcObj); virtual void applyDel(Document &Doc, TransactionalObject *pcObj); @@ -120,10 +120,10 @@ public: void setProperty(const Property* pcProp); void addOrRemoveProperty(const Property* pcProp, bool add); - virtual unsigned int getMemSize () const; - virtual void Save (Base::Writer &writer) const; + unsigned int getMemSize () const override; + void Save (Base::Writer &writer) const override; /// This method is used to restore properties from an XML document. - virtual void Restore(Base::XMLReader &reader); + void Restore(Base::XMLReader &reader) override; friend class Transaction; @@ -149,10 +149,10 @@ public: /// Construction TransactionDocumentObject(); /// Destruction - virtual ~TransactionDocumentObject(); + ~TransactionDocumentObject() override; - void applyNew(Document &Doc, TransactionalObject *pcObj); - void applyDel(Document &Doc, TransactionalObject *pcObj); + void applyNew(Document &Doc, TransactionalObject *pcObj) override; + void applyDel(Document &Doc, TransactionalObject *pcObj) override; }; class AppExport TransactionFactory @@ -168,8 +168,8 @@ private: static TransactionFactory* self; std::map producers; - TransactionFactory(){} - ~TransactionFactory(){} + TransactionFactory() = default; + ~TransactionFactory() = default; }; template @@ -181,12 +181,12 @@ public: TransactionFactory::instance().addProducer(type, this); } - virtual ~TransactionProducer (){} + ~TransactionProducer () override = default; /** * Creates an instance of the specified transaction object. */ - virtual void* Produce () const + void* Produce () const override { return (new CLASS); } diff --git a/src/App/VRMLObject.cpp b/src/App/VRMLObject.cpp index 0707f0d3eb..e2cb7a8576 100644 --- a/src/App/VRMLObject.cpp +++ b/src/App/VRMLObject.cpp @@ -48,9 +48,7 @@ VRMLObject::VRMLObject() : index(0) Resources.setSize(0); } -VRMLObject::~VRMLObject() -{ -} +VRMLObject::~VRMLObject() = default; short VRMLObject::mustExecute() const { diff --git a/src/App/VRMLObject.h b/src/App/VRMLObject.h index e1423d4e30..50b817ba49 100644 --- a/src/App/VRMLObject.h +++ b/src/App/VRMLObject.h @@ -38,28 +38,28 @@ class AppExport VRMLObject : public GeoFeature public: /// Constructor VRMLObject(); - virtual ~VRMLObject(); + ~VRMLObject() override; /// returns the type name of the ViewProvider - virtual const char* getViewProviderName() const { + const char* getViewProviderName() const override { return "Gui::ViewProviderVRMLObject"; } - virtual DocumentObjectExecReturn *execute() { + DocumentObjectExecReturn *execute() override { return DocumentObject::StdReturn; } - virtual short mustExecute() const; - virtual PyObject *getPyObject(); - virtual void Save (Base::Writer &writer) const; - virtual void Restore(Base::XMLReader &reader); - virtual void SaveDocFile (Base::Writer &writer) const; - virtual void RestoreDocFile(Base::Reader &reader); + short mustExecute() const override; + PyObject *getPyObject() override; + void Save (Base::Writer &writer) const override; + void Restore(Base::XMLReader &reader) override; + void SaveDocFile (Base::Writer &writer) const override; + void RestoreDocFile(Base::Reader &reader) override; PropertyFileIncluded VrmlFile; PropertyStringList Urls; PropertyStringList Resources; protected: - void onChanged(const App::Property*); + void onChanged(const App::Property*) override; std::string getRelativePath(const std::string&, const std::string&) const; std::string fixRelativePath(const std::string&, const std::string&) const; void makeDirectories(const std::string&, const std::string&);