@@ -64,6 +64,7 @@ concept HasAxisDefinition =
6464 };
6565
6666using LayerNodePtr = std::shared_ptr<LayerBlueprintNode>;
67+ using BlueprintNodePtr = std::shared_ptr<BlueprintNode>;
6768using ContainerNodePtr = std::shared_ptr<ContainerBlueprintNode>;
6869using SurfacePtr = std::shared_ptr<Acts::Surface>;
6970using SurfaceVector = std::vector<SurfacePtr>;
@@ -72,63 +73,55 @@ using SurfaceVector = std::vector<SurfacePtr>;
7273// /
7374// / Receives the source layer element (or @c std::nullopt when no element
7475// / context exists) and the newly created layer node, and returns the
75- // / (possibly replaced) node to be added to the container.
76+ // / (possibly replaced or wrapped) @ref BlueprintNode to be added to the
77+ // / container.
7678template <typename ElementT>
77- using LayerCustomizer = std::function<std::shared_ptr<LayerBlueprintNode> (
78- const std::optional<ElementT>&, std::shared_ptr<LayerBlueprintNode> )>;
79+ using LayerCustomizer = std::function<BlueprintNodePtr (
80+ const std::optional<ElementT>&, LayerNodePtr )>;
7981
80- // / @brief Callback type that can replace or wrap a
81- // / @ref CylinderContainerBlueprintNode.
82+ // / @brief Callback type that can replace or wrap a created container node.
83+ // /
84+ // / Receives the source container element and the newly created
85+ // / @ref ContainerBlueprintNode, and returns the (possibly replaced or wrapped)
86+ // / @ref BlueprintNode to be added to the parent.
8287template <typename ElementT>
8388using ContainerCustomizer =
84- std::function<std::shared_ptr<ContainerBlueprintNode>(
85- const ElementT&, std::shared_ptr<ContainerBlueprintNode>)>;
89+ std::function<BlueprintNodePtr(const ElementT&, ContainerNodePtr)>;
8690
87- // / @brief Concept satisfied when @p CallableT can be called with an optional
88- // / element and a @ref LayerBlueprintNode shared pointer and returns a (possibly
89- // / different) @ref LayerBlueprintNode shared pointer.
90- // /
91- // / Used to constrain the returning form of the `onLayer` callback accepted by
92- // / the assembler builders.
91+ // / @brief Concept satisfied when @p CallableT is an `onLayer` callback that
92+ // / returns a (possibly replaced or wrapped) @ref BlueprintNode.
9393template <typename ElementT, typename CallableT>
94- concept LayerNodeReturningCallable =
94+ concept OnLayerReturnsNode =
9595 std::invocable<CallableT&, const std::optional<ElementT>&, LayerNodePtr> &&
9696 std::same_as<std::invoke_result_t <
9797 CallableT&, const std::optional<ElementT>&, LayerNodePtr>,
98- LayerNodePtr >;
98+ BlueprintNodePtr >;
9999
100- // / @brief Concept satisfied when @p CallableT can be called with an optional
101- // / element and a mutable @ref LayerBlueprintNode reference and returns `void`.
102- // /
103- // / Used to constrain the in-place (mutating) form of the `onLayer` callback.
100+ // / @brief Concept satisfied when @p CallableT is an `onLayer` callback that
101+ // / mutates the created @ref LayerBlueprintNode in place and returns `void`.
104102template <typename ElementT, typename CallableT>
105- concept LayerNodeReplacingCallable =
103+ concept OnLayerMutatesLayer =
106104 std::invocable<CallableT&, const std::optional<ElementT>&,
107105 LayerBlueprintNode&> &&
108106 std::same_as<
109107 std::invoke_result_t <CallableT&, const std::optional<ElementT>&,
110108 LayerBlueprintNode&>,
111109 void >;
112110
113- // / @brief Concept satisfied when @p CallableT can be called with an element and
114- // / a @ref ContainerBlueprintNode shared pointer and returns a (possibly
115- // / different) @ref ContainerBlueprintNode shared pointer.
116- // /
117- // / Used to constrain the returning form of the `onContainer` callback.
111+ // / @brief Concept satisfied when @p CallableT is an `onContainer` callback
112+ // / that returns a (possibly replaced or wrapped) @ref BlueprintNode.
118113template <typename ElementT, typename CallableT>
119- concept ContainerNodeReturningCallable =
114+ concept OnContainerReturnsNode =
120115 std::invocable<CallableT&, const ElementT&, ContainerNodePtr> &&
121116 std::same_as<
122117 std::invoke_result_t <CallableT&, const ElementT&, ContainerNodePtr>,
123- ContainerNodePtr >;
118+ BlueprintNodePtr >;
124119
125- // / @brief Concept satisfied when @p CallableT can be called with an element and
126- // / a mutable @ref ContainerBlueprintNode reference and returns `void`.
127- // /
128- // / Used to constrain the in-place (mutating) form of the `onContainer`
129- // / callback.
120+ // / @brief Concept satisfied when @p CallableT is an `onContainer` callback
121+ // / that mutates the created @ref ContainerBlueprintNode in place and returns
122+ // / `void`.
130123template <typename ElementT, typename CallableT>
131- concept ContainerNodeReplacingCallable =
124+ concept OnContainerMutatesContainer =
132125 std::invocable<CallableT&, const ElementT&, ContainerBlueprintNode&> &&
133126 std::same_as<std::invoke_result_t <CallableT&, const ElementT&,
134127 ContainerBlueprintNode&>,
@@ -265,7 +258,7 @@ class ElementLayerAssembler {
265258 using AxisDefinition =
266259 std::conditional_t <detail::HasAxisDefinition<BackendT>,
267260 typename BackendT::AxisDefinition, std::monostate>;
268- // / Callback type that can replace or wrap a @ref LayerBlueprintNode.
261+ // / Callback type that can replace or wrap a created @ref LayerBlueprintNode.
269262 using LayerCustomizer = detail::LayerCustomizer<Element>;
270263
271264 // / @brief Set the layer geometry type explicitly.
@@ -399,21 +392,19 @@ class ElementLayerAssembler {
399392 // / @brief Register a callback invoked for each created layer node.
400393 // /
401394 // / The callback may either:
402- // / - return a (possibly replaced/ wrapped) @ref LayerBlueprintNode , or
403- // / - mutate a @ref LayerBlueprintNode in-place and return `void`.
395+ // / - return a (possibly replaced or wrapped) @ref BlueprintNode , or
396+ // / - mutate the created @ref LayerBlueprintNode in-place and return `void`.
404397 // /
405398 // / In both cases, the first argument is the source layer element.
406399 // / @param customizer Callback applied to each created layer node.
407400 // / @return `*this` (rvalue).
408401 template <typename CustomizerT>
409402 [[nodiscard]] ElementLayerAssembler&& onLayer(CustomizerT customizer) &&
410- requires (
411- detail::LayerNodeReturningCallable<Element,
412- std::decay_t <CustomizerT>> ||
413- detail::LayerNodeReplacingCallable<Element, std::decay_t <CustomizerT>>)
403+ requires (detail::OnLayerReturnsNode<Element, std::decay_t <CustomizerT>> ||
404+ detail::OnLayerMutatesLayer<Element, std::decay_t <CustomizerT>>)
414405 {
415- if constexpr (detail::LayerNodeReturningCallable<
416- Element, std::decay_t <CustomizerT>>) {
406+ if constexpr (detail::OnLayerReturnsNode<Element,
407+ std::decay_t <CustomizerT>>) {
417408 m_onLayer = std::move (customizer);
418409 } else {
419410 m_onLayer = [customizer = std::move (customizer)](
@@ -522,7 +513,7 @@ class SensorLayerAssembler {
522513 using AxisDefinition =
523514 std::conditional_t <detail::HasAxisDefinition<BackendT>,
524515 typename BackendT::AxisDefinition, std::monostate>;
525- // / Callback type that can replace or wrap a @ref LayerBlueprintNode.
516+ // / Callback type that can replace or wrap a created @ref LayerBlueprintNode.
526517 using LayerCustomizer = detail::LayerCustomizer<Element>;
527518 // / Callable that maps a sensor element to a string group key.
528519 using LayerGrouper = std::function<std::string(const Element&)>;
@@ -597,19 +588,18 @@ class SensorLayerAssembler {
597588
598589 // / @brief Register a callback invoked for each created layer node.
599590 // /
600- // / The callback may either return a (possibly replaced/wrapped) layer node,
601- // / or mutate a layer node in-place and return `void`.
591+ // / The callback may either return a (possibly replaced or wrapped)
592+ // / @ref BlueprintNode, or mutate the created @ref LayerBlueprintNode
593+ // / in-place and return `void`.
602594 // / @param customizer Callback applied to each created layer node.
603595 // / @return `*this` (rvalue).
604596 template <typename CustomizerT>
605597 [[nodiscard]] SensorLayerAssembler&& onLayer(CustomizerT customizer) &&
606- requires (
607- detail::LayerNodeReturningCallable<Element,
608- std::decay_t <CustomizerT>> ||
609- detail::LayerNodeReplacingCallable<Element, std::decay_t <CustomizerT>>)
598+ requires (detail::OnLayerReturnsNode<Element, std::decay_t <CustomizerT>> ||
599+ detail::OnLayerMutatesLayer<Element, std::decay_t <CustomizerT>>)
610600 {
611- if constexpr (detail::LayerNodeReturningCallable<
612- Element, std::decay_t <CustomizerT>>) {
601+ if constexpr (detail::OnLayerReturnsNode<Element,
602+ std::decay_t <CustomizerT>>) {
613603 m_onLayer = std::move (customizer);
614604 } else {
615605 m_onLayer = [customizer = std::move (customizer)](
@@ -694,7 +684,7 @@ class SensorLayer {
694684 using AxisDefinition =
695685 std::conditional_t <detail::HasAxisDefinition<BackendT>,
696686 typename BackendT::AxisDefinition, std::monostate>;
697- // / Callback type that can replace or wrap a @ref LayerBlueprintNode.
687+ // / Callback type that can replace or wrap a created @ref LayerBlueprintNode.
698688 using LayerCustomizer = detail::LayerCustomizer<Element>;
699689
700690 // / @brief Set the layer geometry type explicitly.
@@ -747,19 +737,18 @@ class SensorLayer {
747737
748738 // / @brief Register a callback invoked for the created layer node.
749739 // /
750- // / The callback may either return a (possibly replaced/wrapped) layer node,
751- // / or mutate a layer node in-place and return `void`.
740+ // / The callback may either return a (possibly replaced or wrapped)
741+ // / @ref BlueprintNode, or mutate the created @ref LayerBlueprintNode
742+ // / in-place and return `void`.
752743 // / @param customizer Callback applied to the created layer node.
753744 // / @return `*this` (rvalue).
754745 template <typename CustomizerT>
755746 [[nodiscard]] SensorLayer&& onLayer(CustomizerT customizer) &&
756- requires (
757- detail::LayerNodeReturningCallable<Element,
758- std::decay_t <CustomizerT>> ||
759- detail::LayerNodeReplacingCallable<Element, std::decay_t <CustomizerT>>)
747+ requires (detail::OnLayerReturnsNode<Element, std::decay_t <CustomizerT>> ||
748+ detail::OnLayerMutatesLayer<Element, std::decay_t <CustomizerT>>)
760749 {
761- if constexpr (detail::LayerNodeReturningCallable<
762- Element, std::decay_t <CustomizerT>>) {
750+ if constexpr (detail::OnLayerReturnsNode<Element,
751+ std::decay_t <CustomizerT>>) {
763752 m_onLayer = std::move (customizer);
764753 } else {
765754 m_onLayer = [customizer = std::move (customizer)](
@@ -778,8 +767,8 @@ class SensorLayer {
778767 // / requires axes and none were provided, if sensors are not set,
779768 // / or
780769 // / if @ref setLayerName has not been called.
781- // / @return Shared pointer to the assembled @ref LayerBlueprintNode .
782- [[nodiscard]] std::shared_ptr<LayerBlueprintNode > build () const ;
770+ // / @return Shared pointer to the assembled @ref BlueprintNode .
771+ [[nodiscard]] std::shared_ptr<BlueprintNode > build () const ;
783772
784773 // / @brief Build the layer node and attach it as a child of @p node.
785774 // /
@@ -841,8 +830,7 @@ class BarrelEndcapAssembler {
841830 // / The @ref ElementLayerAssembler specialisation for this backend.
842831 using ElementLayerAssembler =
843832 ::Acts::Experimental::ElementLayerAssembler<BackendT>;
844- // / Callback type that can replace or wrap a
845- // / @ref CylinderContainerBlueprintNode.
833+ // / Callback type that can replace or wrap a created container node.
846834 using ContainerCustomizer = detail::ContainerCustomizer<Element>;
847835
848836 // / @brief Construct a @ref BarrelEndcapAssembler bound to @p builder.
@@ -875,19 +863,18 @@ class BarrelEndcapAssembler {
875863 // / @brief Register a layer callback forwarded to each inner
876864 // / @ref ElementLayerAssembler.
877865 // /
878- // / The callback may either return a (possibly replaced/wrapped) layer node,
879- // / or mutate a layer node in-place and return `void`.
866+ // / The callback may either return a (possibly replaced or wrapped)
867+ // / @ref BlueprintNode, or mutate the created @ref LayerBlueprintNode
868+ // / in-place and return `void`.
880869 // / @param customizer Callback applied to each created layer node.
881870 // / @return `*this` (rvalue).
882871 template <typename CustomizerT>
883872 [[nodiscard]] BarrelEndcapAssembler&& onLayer(CustomizerT customizer) &&
884- requires (
885- detail::LayerNodeReturningCallable<Element,
886- std::decay_t <CustomizerT>> ||
887- detail::LayerNodeReplacingCallable<Element, std::decay_t <CustomizerT>>)
873+ requires (detail::OnLayerReturnsNode<Element, std::decay_t <CustomizerT>> ||
874+ detail::OnLayerMutatesLayer<Element, std::decay_t <CustomizerT>>)
888875 {
889- if constexpr (detail::LayerNodeReturningCallable<
890- Element, std::decay_t <CustomizerT>>) {
876+ if constexpr (detail::OnLayerReturnsNode<Element,
877+ std::decay_t <CustomizerT>>) {
891878 m_onLayer = std::move (customizer);
892879 } else {
893880 m_onLayer = [customizer = std::move (customizer)](
@@ -903,20 +890,20 @@ class BarrelEndcapAssembler {
903890 // / @brief Register a callback invoked for each barrel or endcap container
904891 // / node.
905892 // /
906- // / The callback may either return a (possibly replaced/wrapped) container
907- // / node, or mutate a container node in-place and return `void`.
893+ // / The callback may either return a (possibly replaced or wrapped)
894+ // / @ref BlueprintNode, or mutate the created @ref ContainerBlueprintNode
895+ // / in-place and return `void`.
908896 // / @param customizer Callback applied to each created barrel or endcap
909897 // / container node.
910898 // / @return `*this` (rvalue).
911899 template <typename CustomizerT>
912900 [[nodiscard]] BarrelEndcapAssembler&& onContainer(CustomizerT customizer) &&
913- requires (detail::ContainerNodeReturningCallable<
914- Element, std::decay_t <CustomizerT>> ||
915- detail::ContainerNodeReplacingCallable<Element,
916- std::decay_t <CustomizerT>>)
901+ requires (
902+ detail::OnContainerReturnsNode<Element, std::decay_t <CustomizerT>> ||
903+ detail::OnContainerMutatesContainer<Element, std::decay_t <CustomizerT>>)
917904 {
918- if constexpr (detail::ContainerNodeReturningCallable<
919- Element, std::decay_t <CustomizerT>>) {
905+ if constexpr (detail::OnContainerReturnsNode<Element,
906+ std::decay_t <CustomizerT>>) {
920907 m_onContainer = std::move (customizer);
921908 } else {
922909 m_onContainer =
0 commit comments