File indexing completed on 2026-09-09 08:18:13
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011
0012 #ifdef ACTS_CORE_GEOMETRYCONTEXT_PLUGIN
0013 #include ACTS_CORE_GEOMETRYCONTEXT_PLUGIN
0014 #else
0015
0016 #include "Acts/Utilities/Diagnostics.hpp"
0017 #include "Acts/Utilities/detail/ContextType.hpp"
0018
0019 #include <ostream>
0020
0021 namespace Acts {
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046 class GeometryContext : public ContextType {
0047 public:
0048
0049
0050
0051
0052 static GeometryContext dangerouslyDefaultConstruct() {
0053 ACTS_PUSH_IGNORE_DEPRECATED()
0054 return GeometryContext();
0055 ACTS_POP_IGNORE_DEPRECATED()
0056 }
0057
0058
0059
0060
0061 template <typename T>
0062 requires(!std::is_same_v<std::decay_t<T>, GeometryContext> &&
0063 !std::is_base_of_v<ContextType, std::decay_t<T> >)
0064 explicit GeometryContext(T&& value) : ContextType(std::forward<T>(value)) {}
0065
0066
0067
0068
0069 template <typename T>
0070 requires(!std::is_same_v<std::decay_t<T>, GeometryContext> &&
0071 !std::is_base_of_v<ContextType, std::decay_t<T> >)
0072 explicit GeometryContext(const T& value) : ContextType(value) {}
0073
0074
0075 using ContextType::operator=;
0076
0077 private:
0078 GeometryContext() = default;
0079 };
0080
0081
0082
0083
0084
0085
0086
0087 template <typename T>
0088 struct GeometryContextOstreamWrapper {
0089
0090
0091
0092 GeometryContextOstreamWrapper(const T& object, const GeometryContext& gctx)
0093 : m_object(object), m_gctx(gctx) {}
0094
0095 GeometryContextOstreamWrapper(const GeometryContextOstreamWrapper&) = delete;
0096 GeometryContextOstreamWrapper(GeometryContextOstreamWrapper&&) = delete;
0097 GeometryContextOstreamWrapper& operator=(
0098 const GeometryContextOstreamWrapper&) = delete;
0099 GeometryContextOstreamWrapper& operator=(GeometryContextOstreamWrapper&&) =
0100 delete;
0101
0102 friend std::ostream& operator<<(
0103 std::ostream& os, const GeometryContextOstreamWrapper& osWrapper) {
0104 osWrapper.toStream(os);
0105 return os;
0106 }
0107
0108 private:
0109 void toStream(std::ostream& os) const { m_object.toStreamImpl(m_gctx, os); }
0110
0111 const T& m_object;
0112 const GeometryContext& m_gctx;
0113 };
0114
0115 }
0116
0117 #endif