From d54baac691dfb962076a609c46f349ad5277c601 Mon Sep 17 00:00:00 2001
From: Paul Gessinger <paul.gessinger@cern.ch>
Date: Thu, 15 Aug 2024 12:02:08 +0200
Subject: [PATCH] Unify `Persistifier` typedef

---
 .../GeoModelKernel/GeoShapeIntersection.h     |  4 +--
 .../GeoModelKernel/GeoShapeShift.h            |  6 +---
 .../GeoModelKernel/GeoShapeSubtraction.h      |  6 +---
 .../GeoModelKernel/GeoShapeUnion.h            |  5 +---
 .../GeoModelKernel/PersistifierFwd.h          | 30 +++++++++++++++++++
 .../GeoModelRead/GeoModelRead/ReadGeoModel.h  | 22 +-------------
 6 files changed, 35 insertions(+), 38 deletions(-)
 create mode 100644 GeoModelCore/GeoModelKernel/GeoModelKernel/PersistifierFwd.h

diff --git a/GeoModelCore/GeoModelKernel/GeoModelKernel/GeoShapeIntersection.h b/GeoModelCore/GeoModelKernel/GeoModelKernel/GeoShapeIntersection.h
index 029b7ce78..7c1027339 100644
--- a/GeoModelCore/GeoModelKernel/GeoModelKernel/GeoShapeIntersection.h
+++ b/GeoModelCore/GeoModelKernel/GeoModelKernel/GeoShapeIntersection.h
@@ -7,10 +7,8 @@
 
 #include "GeoModelKernel/GeoShape.h"
 #include "GeoModelKernel/GeoIntrusivePtr.h"
+#include "GeoModelKernel/PersistifierFwd.h"
 
-#ifndef _GeoShapePersistification_On_
-  class Persistifier;
-#endif
 
 class GeoShapeIntersection : public GeoShape
 {
diff --git a/GeoModelCore/GeoModelKernel/GeoModelKernel/GeoShapeShift.h b/GeoModelCore/GeoModelKernel/GeoModelKernel/GeoShapeShift.h
index 1274a5144..ab7fa80b8 100644
--- a/GeoModelCore/GeoModelKernel/GeoModelKernel/GeoShapeShift.h
+++ b/GeoModelCore/GeoModelKernel/GeoModelKernel/GeoShapeShift.h
@@ -8,11 +8,7 @@
 #include "GeoModelKernel/GeoShape.h"
 #include "GeoModelKernel/GeoIntrusivePtr.h"
 #include "GeoModelKernel/GeoDefinitions.h"
-
-
-#ifndef _GeoShapePersistification_On_
-  class Persistifier;
-#endif
+#include "GeoModelKernel/PersistifierFwd.h"
 
 
 class GeoShapeShift : public GeoShape {
diff --git a/GeoModelCore/GeoModelKernel/GeoModelKernel/GeoShapeSubtraction.h b/GeoModelCore/GeoModelKernel/GeoModelKernel/GeoShapeSubtraction.h
index 2ab3e08e4..6036e0921 100644
--- a/GeoModelCore/GeoModelKernel/GeoModelKernel/GeoShapeSubtraction.h
+++ b/GeoModelCore/GeoModelKernel/GeoModelKernel/GeoShapeSubtraction.h
@@ -7,11 +7,7 @@
 
 #include "GeoModelKernel/GeoShape.h"
 #include "GeoModelKernel/GeoIntrusivePtr.h"
-
-
-#ifndef _GeoShapePersistification_On_
-  class Persistifier;
-#endif
+#include "GeoModelKernel/PersistifierFwd.h"
 
 
 class GeoShapeSubtraction : public GeoShape {
diff --git a/GeoModelCore/GeoModelKernel/GeoModelKernel/GeoShapeUnion.h b/GeoModelCore/GeoModelKernel/GeoModelKernel/GeoShapeUnion.h
index b712b180a..7849753e5 100644
--- a/GeoModelCore/GeoModelKernel/GeoModelKernel/GeoShapeUnion.h
+++ b/GeoModelCore/GeoModelKernel/GeoModelKernel/GeoShapeUnion.h
@@ -7,10 +7,7 @@
 
 #include "GeoModelKernel/GeoShape.h"
 #include "GeoModelKernel/GeoIntrusivePtr.h"
-
-#ifndef _GeoShapePersistification_On_
-  class Persistifier;
-#endif
+#include "GeoModelKernel/PersistifierFwd.h"
 
 class GeoShapeUnion : public GeoShape
 {
diff --git a/GeoModelCore/GeoModelKernel/GeoModelKernel/PersistifierFwd.h b/GeoModelCore/GeoModelKernel/GeoModelKernel/PersistifierFwd.h
new file mode 100644
index 000000000..025d31cc7
--- /dev/null
+++ b/GeoModelCore/GeoModelKernel/GeoModelKernel/PersistifierFwd.h
@@ -0,0 +1,30 @@
+/*
+  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef GEOMODELKERNEL_PERSISTIFIERFWD_H
+#define GEOMODELKERNEL_PERSISTIFIERFWD_H
+
+// ****************************************************************
+// *** PERSISTIFICATION SETTINGS FOR GeoModel BOOLEAN SHAPES ******
+// ****************************************************************
+// Note:
+// -- The instructions below are needed
+// -- to correctly persistify/restore boolean shapes.
+// -- They must be declared before including GeoModelKernel files.
+// ****************************************************************
+// This variable is used by GeoModel boolean shapes to switch ON
+// the persistification mode
+#define _GeoShapePersistification_On_
+// fwd declaration of namespace::class we want to use to persistify
+// the GeoModel boolean shapes
+namespace GeoModelIO {
+class ReadGeoModel;
+}
+// the 'Persistifier' class name is used by GeoModel boolean shapes
+// to grant access to friend classes
+typedef GeoModelIO::ReadGeoModel Persistifier;
+// ****************************************************************
+// ****************************************************************
+
+#endif
diff --git a/GeoModelIO/GeoModelRead/GeoModelRead/ReadGeoModel.h b/GeoModelIO/GeoModelRead/GeoModelRead/ReadGeoModel.h
index 8acf829c2..39aaf8051 100644
--- a/GeoModelIO/GeoModelRead/GeoModelRead/ReadGeoModel.h
+++ b/GeoModelIO/GeoModelRead/GeoModelRead/ReadGeoModel.h
@@ -31,29 +31,9 @@
 #ifndef GeoModelRead_ReadGeoModel_H_
 #define GeoModelRead_ReadGeoModel_H_
 
-// ****************************************************************
-// *** PERSISTIFICATION SETTINGS FOR GeoModel BOOLEAN SHAPES ******
-// ****************************************************************
-// Note:
-// -- The instructions below are needed
-// -- to correctly persistify/restore boolean shapes.
-// -- They must be declared before including GeoModelKernel files.
-// ****************************************************************
-// This variable is used by GeoModel boolean shapes to switch ON
-// the persistification mode
-#define _GeoShapePersistification_On_
-// fwd declaration of namespace::class we want to use to persistify
-// the GeoModel boolean shapes
-namespace GeoModelIO {
-class ReadGeoModel;
-}
-// the 'Persistifier' class name is used by GeoModel boolean shapes
-// to grant access to friend classes
-typedef GeoModelIO::ReadGeoModel Persistifier;
-// ****************************************************************
-// ****************************************************************
 
 // GeoModel includes
+#include "GeoModelKernel/PersistifierFwd.h"
 #include "GeoModelDBManager/GMDBManager.h"
 #include "GeoModelDBManager/definitions.h"
 
-- 
GitLab