[vtk-developers] STL in VTK Header Files

Thompson, David C dcthomp at sandia.gov
Sun Jun 7 12:57:32 EDT 2009


The other occasion I can think of that will require an exception
is when a private implementation must be shared between
classes such as Hybrid/vtkExodusIIReaderPrivate.h or
IO/vtkMySQLDatabasePrivate.h. These header files are usually
not subclasses of vtkObject and listed in the HeaderTesting
exceptions -- both of which could help automate adding an
exception to the CVS commit check for them.

    David
________________________________________
From: vtk-developers-bounces at vtk.org [vtk-developers-bounces at vtk.org] On Behalf Of Berk Geveci [berk.geveci at kitware.com]
Sent: Friday, June 05, 2009 18:47
To: Dave Partyka
Cc: VTK Developers
Subject: Re: [vtk-developers] STL in VTK Header Files

Is there a way of by-passing this commit check? There are a rare
occasions where it may be necessary to commit code which include STL
headers in .h files.

To remind everyone why the decision to keep STL headers from include
files was made: performance. STL headers are bulky and may slow down
compilation significantly if they are included in header files that
are included by a lot of other files. Including STL headers in the
include files of leaf classes (such as concrete algorithm classes)
does not have any effect on compilation time. There are no other good
reasons why STL headers cannot be included in header files.

Here is the catch: we occasionally receive contributions that include
STL header in .h. These tend to be super big reader classes. Fixing
the whole darn thing to use PIMPL is a waste of time which we don't
have. So, if we do not provide a way of having exception to this rule,
those contributions would never make it into VTK.

So we should either provide a way of by-passing this commit check in
these rare occasions or we should enforce this through a header test
which can support such exceptions.

-berk

On Fri, Jun 5, 2009 at 5:13 PM, Francois
Bertel<francois.bertel at kitware.com> wrote:
> Isn't already enforced by HeaderTesting-* tests ?
>
> PS: I continue the discussion on vtk-developers only as this is the
> canonic place to discuss about this topic.
>
> On Fri, Jun 5, 2009 at 4:42 PM, Dave Partyka<dave.partyka at kitware.com> wrote:
>> Hi everyone,
>> A new CVS commit check has been added to prevent commits of VTK header files
>> that contain STL includes. Exceptions can be added by contacting myself or
>> Brad King.
>> I also want to give a friendly reminder that the VTK coding standards (VTK
>> has coding standards???) provide guidelines for using STL in VTK and require
>> that STL not be used in header files. See the following for more information
>> or feel free to ask me if you have any questions.
>> VTK Coding Standards:
>> http://www.vtk.org/Wiki/VTK_Coding_Standards
>> VTK FAQ regarding STL
>> http://www.vtk.org/Wiki/VTK_FAQ#Can_I_use_STL_with_VTK.3F
>> Also please report any problems/bugs with the new commit check to myself or
>> Brad King.
>> Thanks very much!
>
>
>
> --
> François Bertel, PhD  | Kitware Inc. Suite 204
> 1 (518) 371 3971 x113 | 28 Corporate Drive
>                      | Clifton Park NY 12065, USA
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtk-developers






More information about the vtk-developers mailing list