Misc: modernize C++: use override

This commit is contained in:
wmayer
2023-08-04 14:37:25 +02:00
committed by wwmayer
parent ed251a914b
commit b8a7849dd3
12 changed files with 23 additions and 22 deletions

View File

@@ -57,7 +57,7 @@ namespace @self.export.Namespace.replace("::"," { namespace ")@
class @self.export.Namespace.replace("::","_")@Export @self.export.Name@ : public @self.export.FatherNamespace@::@self.export.Father@
{
protected:
~@self.export.Name@();
~@self.export.Name@() override;
public:
static PyTypeObject Type;
@@ -79,12 +79,12 @@ public:
static int descriptorSetter(PyObject* self, PyObject* obj, PyObject* value);
-
static PyGetSetDef GetterSetter[];
virtual PyTypeObject *GetType() {return &Type;}
PyTypeObject *GetType() override {return &Type;}
public:
@self.export.Name@(@self.export.TwinPointer@ *pcObject, PyTypeObject *T = &Type);
static PyObject *PyMake(struct _typeobject *, PyObject *, PyObject *);
virtual int PyInit(PyObject* args, PyObject*k);
int PyInit(PyObject* args, PyObject*k) override;
+ if (self.export.Initialization):
int initialization();
@@ -93,7 +93,7 @@ public:
using PointerType = @self.export.TwinPointer@*;
virtual PyObject *_repr(); // the representation
PyObject *_repr() override; // the representation
std::string representation() const;
/** @name callbacks and implementers for the python object methods */
@@ -232,8 +232,8 @@ public:
/// setter for special attributes (e.g. dynamic ones)
/// Output: Success=1, Failure=-1, Ignore=0
int setCustomAttributes(const char* attr, PyObject *obj);
PyObject *_getattr(const char *attr); // __getattr__ function
int _setattr(const char *attr, PyObject *value); // __setattr__ function
PyObject *_getattr(const char *attr) override; // __getattr__ function
int _setattr(const char *attr, PyObject *value) override; // __setattr__ function
-
/// getter for the object handled by this class