[vtk-developers] GeoJSONReader HeaderTest failed due to Multiple Includes

Marcus D. Hanwell marcus.hanwell at kitware.com
Thu Jun 26 13:17:11 EDT 2014


On Thu, Jun 26, 2014 at 11:49 AM, David E DeMarle
<dave.demarle at kitware.com> wrote:
>
> On Thu, Jun 26, 2014 at 10:47 AM, Jatin Parekh <jatinparekh93 at gmail.com>
> wrote:
>>
>> VTKIOGEOJSON_EXPORT
>
>
> Means that you need to put this macro (defined by vtk's cmake scripts) in
> your class definitions. It makes declspecs for windows shared lib builds. As
> Aashish says, see other vtk headers for examples. You will see how they all
> include a configured header that defines it.
>
>> has 2 includes
>
>
> The multiple headers is a vtk style guideline. To keep compilation quick and
> declarations contained the guidelines recommend a single include per header
> file. In practice we need two since modularization for the modern export
> macros but that is beside the point. If you need more than three includes in
> your header then you should rethink the design. If you have two or three
> then you can get through this style check by adding a short comment after
> each include which describes why you need to include more than one header.
>
Looking at some of your headers it is clear you have a lot of includes
that should just be in the implementation, and you should forward
declare classes that you just need as pointers/references in the API.
https://github.com/jatin3893/vtkDataSetReaders/blob/master/vtkGeoJSONReader.h
contains many things that I don't see referenced in the header. I hope
you can keep the JSON include to the implementation.

Marcus



More information about the vtk-developers mailing list