[vtk-developers] Unique PIMPL class names

David Thompson dcthomp at sandia.gov
Thu Jan 9 16:05:56 EST 2003


> So, there are classes in VTK which in .cxx files use "private" classes
> such as:
> 
> vtkObserver
> vtkMemoryPool
> vtkNeighborPoints
> vtkFieldNode
> vtkPWCallback
> vtkColorHash
> 
> Since some of them are pretty generic names, I would suggest an
> amendment to the coding standard which says:
> 
> All internally used classes have to have a name with the prefix of the
> VTK class that is using it. For example if class vtkFoo needs a helper
> class Bar, the helper classes name should be vtkFooBar and not vtkBar.
> 
> I would be willing to go through VTK and fix the current classes name,
> but only if I will not be accused of being mad (again).
> 
> Comments?
Why not declare them as member classes of vtkFoo instead of
making really long classnames?
class vtkFoo
{
  private:
    class Bar {
    }
};

Inside member functions of vtkFoo, you don't need to type
vtkFooBar, just Bar. If declared as private members (as
above) no one can use this class externally. If declared
as public members, then others can reference the class
name as vtkFoo::Bar.

		David





More information about the vtk-developers mailing list