[geos-commits] [SCM] GEOS branch main updated. f3edf738f78957ca9fd912764bddab04dbb02e6b

git at osgeo.org git at osgeo.org
Wed Nov 6 11:36:11 PST 2024


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GEOS".

The branch, main has been updated
       via  f3edf738f78957ca9fd912764bddab04dbb02e6b (commit)
      from  bf3579eaaca82109789d392774147ce0292e851c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit f3edf738f78957ca9fd912764bddab04dbb02e6b
Author: Martin Davis <mtnclimb at gmail.com>
Date:   Wed Nov 6 11:35:49 2024 -0800

    Update Dev Notes

diff --git a/DEVELOPER-NOTES.md b/DEVELOPER-NOTES.md
index fd0ea8b96..b81594b60 100644
--- a/DEVELOPER-NOTES.md
+++ b/DEVELOPER-NOTES.md
@@ -87,4 +87,25 @@ public:
     * It lowers the number of heap allocations, because it allocates larger blocks of space to store multiple `HalfEdge` objects.
     * It handles the lifecycle of the `HalfEdge` objects that make up the `EdgeGraph`, because when the `EdgeGraph` is deallocated, the `std::deque<>` and all its contents are also automatically deallocated.
 
+### Use forward declarations in header files
 
+Where possible, in header files use **forward declarations** rather than header includes.
+This cuts the include dependency chain, which reduces the recompilation required when a low-level class header changes.
+Includes are only needed where the class contents are referred to, not just the class name.
+
+E.g. use this
+```
+namespace geos {
+namespace geom {
+class Geometry;
+}
+}
+```
+rather than:
+```
+#include <geos/geom/Geometry.h>
+```
+
+### Use `pragma once` to limit header inclusion
+
+Use `#pragma once` to limit header inclusion.  It is simpler and faster.

-----------------------------------------------------------------------

Summary of changes:
 DEVELOPER-NOTES.md | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list