Commit 99852229 authored by Robert Maynard's avatar Robert Maynard

Resolve missing override warnings from NewInstance method.

This adds a new macro to vtkSetGet that direct children of vtkObjectBase
should call instead of vtkTypeMacro. By doing so we properly resolve all
warnings about missing override keyword from NewInstance.
parent 05e597c3
Pipeline #22787 passed with stage
......@@ -338,7 +338,7 @@
class VTKCOMMONCORE_EXPORT vtkCommand : public vtkObjectBase
{
public:
vtkTypeMacro(vtkCommand,vtkObjectBase);
vtkBaseTypeMacro(vtkCommand,vtkObjectBase);
// Description:
// Decrease the reference count (release by another object). This has
......
......@@ -39,7 +39,7 @@ void vtkInformationDoubleKey::PrintSelf(ostream& os, vtkIndent indent)
class vtkInformationDoubleValue: public vtkObjectBase
{
public:
vtkTypeMacro(vtkInformationDoubleValue, vtkObjectBase);
vtkBaseTypeMacro(vtkInformationDoubleValue, vtkObjectBase);
double Value;
};
......
......@@ -43,7 +43,7 @@ void vtkInformationDoubleVectorKey::PrintSelf(ostream& os, vtkIndent indent)
class vtkInformationDoubleVectorValue: public vtkObjectBase
{
public:
vtkTypeMacro(vtkInformationDoubleVectorValue, vtkObjectBase);
vtkBaseTypeMacro(vtkInformationDoubleVectorValue, vtkObjectBase);
std::vector<double> Value;
};
......
......@@ -39,7 +39,7 @@ void vtkInformationIdTypeKey::PrintSelf(ostream& os, vtkIndent indent)
class vtkInformationIdTypeValue: public vtkObjectBase
{
public:
vtkTypeMacro(vtkInformationIdTypeValue, vtkObjectBase);
vtkBaseTypeMacro(vtkInformationIdTypeValue, vtkObjectBase);
vtkIdType Value;
};
......
......@@ -39,7 +39,7 @@ void vtkInformationIntegerKey::PrintSelf(ostream& os, vtkIndent indent)
class vtkInformationIntegerValue: public vtkObjectBase
{
public:
vtkTypeMacro(vtkInformationIntegerValue, vtkObjectBase);
vtkBaseTypeMacro(vtkInformationIntegerValue, vtkObjectBase);
int Value;
};
......
......@@ -44,7 +44,7 @@ void vtkInformationIntegerPointerKey::PrintSelf(ostream& os, vtkIndent indent)
class vtkInformationIntegerPointerValue: public vtkObjectBase
{
public:
vtkTypeMacro(vtkInformationIntegerPointerValue, vtkObjectBase);
vtkBaseTypeMacro(vtkInformationIntegerPointerValue, vtkObjectBase);
int* Value;
unsigned int Length;
};
......
......@@ -44,7 +44,7 @@ void vtkInformationIntegerVectorKey::PrintSelf(ostream& os, vtkIndent indent)
class vtkInformationIntegerVectorValue: public vtkObjectBase
{
public:
vtkTypeMacro(vtkInformationIntegerVectorValue, vtkObjectBase);
vtkBaseTypeMacro(vtkInformationIntegerVectorValue, vtkObjectBase);
std::vector<int> Value;
};
......
......@@ -35,8 +35,8 @@ class vtkInformation;
class VTKCOMMONCORE_EXPORT vtkInformationKey : public vtkObjectBase
{
public:
vtkTypeMacro(vtkInformationKey,vtkObjectBase);
void PrintSelf(ostream& os, vtkIndent indent);
vtkBaseTypeMacro(vtkInformationKey,vtkObjectBase);
void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
// Description:
// Prevent normal vtkObject reference counting behavior.
......
......@@ -41,7 +41,7 @@ void vtkInformationKeyVectorKey::PrintSelf(ostream& os, vtkIndent indent)
class vtkInformationKeyVectorValue: public vtkObjectBase
{
public:
vtkTypeMacro(vtkInformationKeyVectorValue, vtkObjectBase);
vtkBaseTypeMacro(vtkInformationKeyVectorValue, vtkObjectBase);
std::vector<vtkInformationKey*> Value;
};
......
......@@ -25,7 +25,7 @@ class vtkInformationObjectBaseVectorValue: public vtkObjectBase
public:
typedef std::vector<vtkSmartPointer<vtkObjectBase> > VectorType;
vtkTypeMacro(vtkInformationObjectBaseVectorValue, vtkObjectBase);
vtkBaseTypeMacro(vtkInformationObjectBaseVectorValue, vtkObjectBase);
std::vector<vtkSmartPointer<vtkObjectBase> > &GetVector()
{
return this->Vector;
......
......@@ -41,7 +41,7 @@ void vtkInformationStringKey::PrintSelf(ostream& os, vtkIndent indent)
class vtkInformationStringValue: public vtkObjectBase
{
public:
vtkTypeMacro(vtkInformationStringValue, vtkObjectBase);
vtkBaseTypeMacro(vtkInformationStringValue, vtkObjectBase);
std::string Value;
};
......
......@@ -45,7 +45,7 @@ void vtkInformationStringVectorKey::PrintSelf(ostream& os, vtkIndent indent)
class vtkInformationStringVectorValue: public vtkObjectBase
{
public:
vtkTypeMacro(vtkInformationStringVectorValue, vtkObjectBase);
vtkBaseTypeMacro(vtkInformationStringVectorValue, vtkObjectBase);
std::vector<std::string> Value;
};
......
......@@ -39,7 +39,7 @@ void vtkInformationUnsignedLongKey::PrintSelf(ostream& os, vtkIndent indent)
class vtkInformationUnsignedLongValue: public vtkObjectBase
{
public:
vtkTypeMacro(vtkInformationUnsignedLongValue, vtkObjectBase);
vtkBaseTypeMacro(vtkInformationUnsignedLongValue, vtkObjectBase);
unsigned long Value;
};
......
......@@ -40,7 +40,7 @@ void vtkInformationVariantKey::PrintSelf(ostream& os, vtkIndent indent)
class vtkInformationVariantValue: public vtkObjectBase
{
public:
vtkTypeMacro(vtkInformationVariantValue, vtkObjectBase);
vtkBaseTypeMacro(vtkInformationVariantValue, vtkObjectBase);
vtkVariant Value;
static vtkVariant Invalid;
};
......
......@@ -44,7 +44,7 @@ void vtkInformationVariantVectorKey::PrintSelf(ostream& os, vtkIndent indent)
class vtkInformationVariantVectorValue: public vtkObjectBase
{
public:
vtkTypeMacro(vtkInformationVariantVectorValue, vtkObjectBase);
vtkBaseTypeMacro(vtkInformationVariantVectorValue, vtkObjectBase);
std::vector<vtkVariant> Value;
static vtkVariant Invalid;
};
......
......@@ -50,7 +50,7 @@ class vtkCommand;
class VTKCOMMONCORE_EXPORT vtkObject : public vtkObjectBase
{
public:
vtkTypeMacro(vtkObject,vtkObjectBase);
vtkBaseTypeMacro(vtkObject,vtkObjectBase);
// Description:
// Create an object with Debug turned off, modified time initialized
......
......@@ -644,6 +644,21 @@ virtual double *Get##name() \
// Macro used to determine whether a class is the same class or
// a subclass of the named class.
#define vtkTypeMacro(thisClass,superclass) \
vtkAbstractTypeMacro(thisClass, superclass) \
protected: \
vtkObjectBase *NewInstanceInternal() const VTK_OVERRIDE \
{ \
return thisClass::New(); \
} \
public:
// Macro to use when you are a direct child class of vtkObjectBase, instead
// of vtkTypeMacro. This is required to properly specify NewInstanceInternal
// as a virtual method.
// It is used to determine whether a class is the same class or a subclass
// of the named class.
#define vtkBaseTypeMacro(thisClass,superclass) \
vtkAbstractTypeMacro(thisClass, superclass) \
protected: \
virtual vtkObjectBase *NewInstanceInternal() const \
......@@ -672,7 +687,7 @@ virtual double *Get##name() \
#define vtkTemplateTypeMacro(thisClass,superclass) \
vtkAbstractTemplateTypeMacro(thisClass, superclass) \
protected: \
virtual vtkObjectBase *NewInstanceInternal() const \
vtkObjectBase *NewInstanceInternal() const VTK_OVERRIDE \
{ \
return thisClass::New(); \
} \
......
......@@ -25,7 +25,7 @@
class vtkInformationQuadratureSchemeDefinitionVectorValue: public vtkObjectBase
{
public:
vtkTypeMacro(vtkInformationQuadratureSchemeDefinitionVectorValue, vtkObjectBase);
vtkBaseTypeMacro(vtkInformationQuadratureSchemeDefinitionVectorValue, vtkObjectBase);
//
vtkInformationQuadratureSchemeDefinitionVectorValue()
{
......
......@@ -41,7 +41,7 @@ void vtkInformationExecutivePortKey::PrintSelf(ostream& os, vtkIndent indent)
class vtkInformationExecutivePortValue: public vtkObjectBase
{
public:
vtkTypeMacro(vtkInformationExecutivePortValue, vtkObjectBase);
vtkBaseTypeMacro(vtkInformationExecutivePortValue, vtkObjectBase);
vtkSmartPointer<vtkExecutive> Executive;
int Port;
};
......
......@@ -49,7 +49,7 @@ void vtkInformationExecutivePortVectorKey::PrintSelf(ostream& os, vtkIndent inde
class vtkInformationExecutivePortVectorValue: public vtkObjectBase
{
public:
vtkTypeMacro(vtkInformationExecutivePortVectorValue, vtkObjectBase);
vtkBaseTypeMacro(vtkInformationExecutivePortVectorValue, vtkObjectBase);
std::vector<vtkExecutive*> Executives;
std::vector<int> Ports;
......
......@@ -75,7 +75,7 @@ namespace
class ProcessBlockData: public vtkObjectBase
{
public:
vtkTypeMacro(ProcessBlockData, vtkObjectBase);
vtkBaseTypeMacro(ProcessBlockData, vtkObjectBase);
vtkInformationVector** In;
vtkInformationVector* Out;
int InSize;
......
......@@ -272,8 +272,8 @@ class TestVTKFiles:
count = 0
lines = []
oldlines = []
typere = "^\s*vtk(Abstract)?Type(Revision)*Macro\s*\(\s*(vtk[^ ,]+)\s*,\s*(vtk[^ \)]+)\s*\)\s*"
typesplitre = "^\s*vtk(Abstract)?Type(Revision)*Macro\s*\("
typere = "^\s*vtk(Abstract|Base)?Type(Revision)*Macro\s*\(\s*(vtk[^ ,]+)\s*,\s*(vtk[^ \)]+)\s*\)\s*"
typesplitre = "^\s*vtk(Abstract|Base)?Type(Revision)*Macro\s*\("
regx = re.compile(typere)
regxs = re.compile(typesplitre)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment