arsf / lag

LiDAR Analysis GUI
GNU General Public License v2.0
22 stars 5 forks source link

Friend Classes #29

Open ada-foss opened 11 years ago

ada-foss commented 11 years ago

Making some unrelated changes I noticed that lidarquadtree (and maybe the main body of LAG) mostly just defines every value and function as protected, then makes the classes that need those classes friends.

I poked around looking at QuadtreeNode as my example. I'm certain that this class is completely internal to the quadtree. QuadtreeNode is not an outward facing class, nothing outside of the library should be able to access it or refer to it, so I would argue that everything that uses it should use only public components (of which there are currently none), and that QuadtreeNode should have no friends at all.

What I would really like is for C++ to be more capable of specifying more exactly what should be able to access what. Or perhaps these classes should be more broken up? Just speculation.