[vtk-developers] CanReadFile : various signatures...

David Cole david.cole at kitware.com
Fri Jul 30 16:05:42 EDT 2010


Running the command shown at the bottom of this email reveals that various
different signatures of CanReadFile are present in VTK.

Is there a preferred one that all readers should aspire to?

Should it be "static" or "virtual"?

In the case of classes that inherit from each other, it should be the same,
shouldn't it?

The particular case that I have a beef with is
./IO/vtkEnSightMasterServerReader.h:  int CanReadFile(const char *fname);

which inherits from:
./IO/vtkGenericEnSightReader.h:  static int CanReadFile(const char
*casefilename);

Because the child class method is not static, I get a "hides parent method"
warning when building ActiViz .NET.
Would the owner of this class mind if the method became static...? Or is
that not advisable for backwards compatibility reasons...?


Thanks,
David C.


Details:

$ find . | grep "\.h$" | xargs grep CanReadFile
./Hybrid/vtkExodusIIReader.h:  int CanReadFile(const char* fname);
./Hybrid/vtkExodusReader.h:  int CanReadFile(const char* fname);
./Hybrid/vtkFacetReader.h:  static int CanReadFile(const char *filename);
./Hybrid/vtkLSDynaReader.h:  int CanReadFile( const char* fname );
./IO/vtkBMPReader.h:  virtual int CanReadFile(const char* fname);
./IO/vtkBYUReader.h:  static int CanReadFile(const char *filename);
./IO/vtkDICOMImageReader.h:  virtual int CanReadFile(const char* fname);
./IO/vtkEnSightMasterServerReader.h:  int CanReadFile(const char *fname);
./IO/vtkGenericEnSightReader.h:  static int CanReadFile(const char
*casefilename);
./IO/vtkGESignaReader.h:  virtual int CanReadFile(const char* fname);
./IO/vtkImageReader2.h:  virtual int CanReadFile(const char*
vtkNotUsed(fname))
./IO/vtkImageReader2Factory.h:// object given a path name to a file.  It
calls CanReadFile on all
./IO/vtkJPEGReader.h:  int CanReadFile(const char* fname);
./IO/vtkMetaImageReader.h:  virtual int CanReadFile(const char* name);
./IO/vtkMINCImageReader.h:  virtual int CanReadFile(const char* name);
./IO/vtkNetCDFCFReader.h:  static int CanReadFile(const char *filename);
./IO/vtkOpenFOAMReader.h:  int CanReadFile(const char *);
./IO/vtkPLYReader.h:  static int CanReadFile(const char *filename);
./IO/vtkPNGReader.h:  virtual int CanReadFile(const char* fname);
./IO/vtkPNMReader.h:  int CanReadFile(const char* fname);
./IO/vtkSLACParticleReader.h:  static int CanReadFile(const char *filename);
./IO/vtkSLACReader.h:  static int CanReadFile(const char *filename);
./IO/vtkSLCReader.h:  int CanReadFile(const char* fname);
./IO/vtkTIFFReader.h:  virtual int CanReadFile(const char* fname);
./IO/vtkXMLCompositeDataReader.h:  virtual int CanReadFileVersion(int major,
int vtkNotUsed(minor))
./IO/vtkXMLReader.h:  virtual int CanReadFile(const char* name);
./IO/vtkXMLReader.h:  virtual int CanReadFileVersion(int major, int minor);
./IO/vtkXMLReader.h:  int CanReadFileVersionString(const char* version);
./IO/vtkXYZMolReader.h:  virtual int CanReadFile(const char* name);
./Parallel/vtkPDataSetReader.h:  int CanReadFile(const char* filename);
./Parallel/vtkPNrrdReader.h:  virtual int CanReadFile(const char *filename);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20100730/5538a7ec/attachment.html>


More information about the vtk-developers mailing list