From a1a720d7195f2b2ae9cfc3875a514e3811bba687 Mon Sep 17 00:00:00 2001
From: Andre Sailer <andre.philippe.sailer@cern.ch>
Date: Mon, 26 Apr 2021 12:03:01 +0200
Subject: [PATCH] DDCore: move create_segmentation to header file so it can be
 used in examples

---
 DDCore/include/DD4hep/detail/SegmentationsInterna.h | 8 ++++++++
 DDCore/src/plugins/ReadoutSegmentations.cpp         | 7 -------
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/DDCore/include/DD4hep/detail/SegmentationsInterna.h b/DDCore/include/DD4hep/detail/SegmentationsInterna.h
index 321cdc98c..a3d35ef45 100644
--- a/DDCore/include/DD4hep/detail/SegmentationsInterna.h
+++ b/DDCore/include/DD4hep/detail/SegmentationsInterna.h
@@ -121,5 +121,13 @@ namespace dd4hep {
   /// Default destructor
   template <typename IMP> inline SegmentationWrapper<IMP>::~SegmentationWrapper()  {
   }
+
+  namespace {
+    template<typename T> SegmentationObject*
+    create_segmentation(const BitFieldCoder* decoder)  {
+      return new SegmentationWrapper<T>(decoder);
+    }
+  }
+
 }         /* End namespace dd4hep                       */
 #endif // DD4HEP_DETAIL_SEGMENTATIONSINTERNA_H
diff --git a/DDCore/src/plugins/ReadoutSegmentations.cpp b/DDCore/src/plugins/ReadoutSegmentations.cpp
index 7462e7d93..8da001cc7 100644
--- a/DDCore/src/plugins/ReadoutSegmentations.cpp
+++ b/DDCore/src/plugins/ReadoutSegmentations.cpp
@@ -18,13 +18,6 @@
 using namespace dd4hep;
 using namespace dd4hep::DDSegmentation;
 
-namespace {
-  template<typename T> dd4hep::SegmentationObject*
-  create_segmentation(const dd4hep::BitFieldCoder* decoder)  {
-    return new dd4hep::SegmentationWrapper<T>(decoder);
-  }
-}
-
 #include "DDSegmentation/NoSegmentation.h"
 DECLARE_SEGMENTATION(NoSegmentation,create_segmentation<dd4hep::DDSegmentation::NoSegmentation>)
 
-- 
GitLab