[vtk-developers] Template expansion in wrappers and ParaView client server wrapping

David Gobbi david.gobbi at gmail.com
Fri Feb 10 15:27:03 EST 2012


Hi Markus,

The error looks identical to an issue that I saw in VTK where the
developers used macros to fool the wrappers into thinking that
vtkIntArray et al had vtkDataArray as their superclass, when the
real superclass was in fact vtkDataArrayTemplate<int>.  With the
new macro expansion code, the wrappers aren't fooled anymore.

I can add special-cases to the wrapper code for these Paraview
classes (as I did for vtkDataArray) until I up with a general solution.

 - David


On Fri, Feb 10, 2012 at 12:34 PM, Marcus D. Hanwell
<marcus.hanwell at kitware.com> wrote:
> Hi David,
>
> It looks like there are some issues introduced in ParaView's client
> server wrapping with the new macro expansion code, I am seeing
> failures such as,
>
> [ 85%] Building CXX object
> ParaViewCore/ServerImplementation/CMakeFiles/vtkPVServerImplementationCS.dir/vtkSIDoubleVectorPropertyClientServer.cxx.o
> /home/marcus/ssd/build/ParaView/ParaViewCore/ServerImplementation/vtkSIDoubleVectorPropertyClientServer.cxx:16:40:
> error: invalid declarator before ‘Command’
> /home/marcus/ssd/build/ParaView/ParaViewCore/ServerImplementation/vtkSIDoubleVectorPropertyClientServer.cxx:
> In function ‘int
> vtkSIDoubleVectorPropertyCommand(vtkClientServerInterpreter*,
> vtkObjectBase*, const char*, const vtkClientServerStream&,
> vtkClientServerStream&)’:
> /home/marcus/ssd/build/ParaView/ParaViewCore/ServerImplementation/vtkSIDoubleVectorPropertyClientServer.cxx:87:42:
> error: expected primary-expression before ‘Command’
> /home/marcus/ssd/build/ParaView/ParaViewCore/ServerImplementation/vtkSIDoubleVectorPropertyClientServer.cxx:87:42:
> error: expected ‘)’ before ‘Command’
> /home/marcus/ssd/build/ParaView/ParaViewCore/ServerImplementation/vtkSIDoubleVectorPropertyClientServer.cxx:
> At global scope:
> /home/marcus/ssd/build/ParaView/ParaViewCore/ServerImplementation/vtkSIDoubleVectorPropertyClientServer.cxx:109:41:
> error: invalid declarator before ‘_Init’
> /home/marcus/ssd/build/ParaView/ParaViewCore/ServerImplementation/vtkSIDoubleVectorPropertyClientServer.cxx:
> In function ‘void
> vtkSIDoubleVectorProperty_Init(vtkClientServerInterpreter*)’:
> /home/marcus/ssd/build/ParaView/ParaViewCore/ServerImplementation/vtkSIDoubleVectorPropertyClientServer.cxx:119:49:
> error: no matching function for call to
> ‘vtkSIVectorPropertyTemplate<double>::vtkSIVectorPropertyTemplate(vtkClientServerInterpreter*&)’
> /home/marcus/ssd/build/ParaView/ParaViewCore/ServerImplementation/vtkSIDoubleVectorPropertyClientServer.cxx:119:49:
> note: candidates are:
> /home/marcus/ssd/src/ParaView/ParaViewCore/ServerImplementation/vtkSIVectorPropertyTemplate.h:68:3:
> note: vtkSIVectorPropertyTemplate<T,
> force_idtype>::vtkSIVectorPropertyTemplate(const
> vtkSIVectorPropertyTemplate<T, force_idtype>&) [with T = double,
> force_idtype = int, vtkSIVectorPropertyTemplate<T, force_idtype> =
> vtkSIVectorPropertyTemplate<double>]
> /home/marcus/ssd/src/ParaView/ParaViewCore/ServerImplementation/vtkSIVectorPropertyTemplate.h:68:3:
> note:   no known conversion for argument 1 from
> ‘vtkClientServerInterpreter*’ to ‘const
> vtkSIVectorPropertyTemplate<double>&’
> /home/marcus/ssd/src/ParaView/ParaViewCore/ServerImplementation/vtkSIVectorPropertyTemplate.h:46:3:
> note: vtkSIVectorPropertyTemplate<T,
> force_idtype>::vtkSIVectorPropertyTemplate() [with T = double,
> force_idtype = int]
> /home/marcus/ssd/src/ParaView/ParaViewCore/ServerImplementation/vtkSIVectorPropertyTemplate.h:46:3:
> note:   candidate expects 0 arguments, 1 provided
> /home/marcus/ssd/src/ParaView/ParaViewCore/ServerImplementation/vtkSIVectorPropertyTemplate.h:47:3:
> error: ‘vtkSIVectorPropertyTemplate<T,
> force_idtype>::~vtkSIVectorPropertyTemplate() [with T = double,
> force_idtype = int]’ is protected
> /home/marcus/ssd/build/ParaView/ParaViewCore/ServerImplementation/vtkSIDoubleVectorPropertyClientServer.cxx:119:49:
> error: within this context
> make[2]: *** [ParaViewCore/ServerImplementation/CMakeFiles/vtkPVServerImplementationCS.dir/vtkSIDoubleVectorPropertyClientServer.cxx.o]
> Error 1
> make[1]: *** [ParaViewCore/ServerImplementation/CMakeFiles/vtkPVServerImplementationCS.dir/all]
> Error 2
> make: *** [all] Error 2
>
> The generated code looks wrong too, things such as the following are appearing,
>
> int vtkSIVectorPropertyTemplate<double>Command(vtkClientServerInterpreter*,
> vtkObjectBase*, const char*, const vtkClientServerStream&,
> vtkClientServerStream& resultStream);
>
> and,
>
> if (vtkSIVectorPropertyTemplate<double>Command(arlu,
> op,method,msg,resultStream))
>    {
>    return 1;
>    }
>
> which becomes,
>
> if (vtkSIVectorPropertyCommand(arlu, op,method,msg,resultStream))
>    {
>    return 1;
>    }
>
> when the commit is reverted locally. Is this a special case we need to
> add to the ParaView code?
>
> Thanks,
>
> Marcus



More information about the vtk-developers mailing list