Skip to content

Commit

Permalink
Merge branch 'main' into feat-validate-track-params
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Oct 29, 2024
2 parents 94ddba5 + d155d23 commit 371692d
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 29 deletions.
19 changes: 7 additions & 12 deletions Core/include/Acts/Geometry/NavigationPolicyFactory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,12 @@ class NavigationPolicyFactory {
namespace detail {

template <typename F, typename... Args>
concept NavigationPolicyIsolatedFactoryConcept = requires(F f) {
{
f(std::declval<const GeometryContext&>(),
std::declval<const TrackingVolume&>(), std::declval<const Logger&>(),
std::declval<Args>()...)
} -> std::derived_from<INavigationPolicy>;

requires NavigationPolicyConcept<decltype(f(
std::declval<const GeometryContext&>(),
std::declval<const TrackingVolume&>(), std::declval<const Logger&>(),
std::declval<Args>()...))>;
concept NavigationPolicyIsolatedFactoryConcept = requires(
F f, const GeometryContext& gctx, const TrackingVolume& volume,
const Logger& logger, Args&&... args) {
{ f(gctx, volume, logger, args...) } -> std::derived_from<INavigationPolicy>;

requires NavigationPolicyConcept<decltype(f(gctx, volume, logger, args...))>;

requires(std::is_copy_constructible_v<Args> && ...);
};
Expand Down Expand Up @@ -205,7 +200,7 @@ class NavigationPolicyFactoryImpl<F, Fs...> : public NavigationPolicyFactory {
template <typename...>
friend class NavigationPolicyFactoryImpl;

NavigationPolicyFactoryImpl(std::tuple<F, Fs...>&& factories)
explicit NavigationPolicyFactoryImpl(std::tuple<F, Fs...>&& factories)
: m_factories(std::move(factories)) {}

std::tuple<F, Fs...> m_factories;
Expand Down
4 changes: 2 additions & 2 deletions Core/include/Acts/Geometry/TrackingVolume.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ class TrackingVolume : public Volume {
~TrackingVolume() override;
TrackingVolume(const TrackingVolume&) = delete;
TrackingVolume& operator=(const TrackingVolume&) = delete;
TrackingVolume(TrackingVolume&&);
TrackingVolume& operator=(TrackingVolume&&);
TrackingVolume(TrackingVolume&&) noexcept;
TrackingVolume& operator=(TrackingVolume&&) noexcept;

/// Constructor for a container Volume
/// - vacuum filled volume either as a for other tracking volumes
Expand Down
8 changes: 5 additions & 3 deletions Core/include/Acts/Navigation/INavigationPolicy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ class INavigationPolicy {
public:
/// Noop update function that is suitable as a default for default navigation
/// delegates.
static void noopInitializeCandidates(const NavigationArguments& /*unused*/,
AppendOnlyNavigationStream& /*unused*/,
const Logger& /*unused*/) {}
static void noopInitializeCandidates(
const NavigationArguments& /*unused*/,
const AppendOnlyNavigationStream& /*unused*/, const Logger& /*unused*/) {
// This is a noop
}

/// Virtual destructor so policies can be held through this base class.
virtual ~INavigationPolicy() = default;
Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/Navigation/MultiNavigationPolicy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class MultiNavigationPolicy final : public MultiNavigationPolicyBase {
public:
/// Constructor from a set of child policies.
/// @param policies The child policies
MultiNavigationPolicy(Policies&&... policies)
explicit MultiNavigationPolicy(Policies&&... policies)
: m_policies{std::move(policies)...} {}

/// Implementation of the connection to a navigation delegate.
Expand Down
7 changes: 4 additions & 3 deletions Core/include/Acts/Navigation/SurfaceArrayNavigationPolicy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,14 @@ class SurfaceArrayNavigationPolicy : public INavigationPolicy {
friend std::ostream& operator<<(std::ostream& os,
const LayerType& layerType) {
switch (layerType) {
case LayerType::Cylinder:
using enum LayerType;
case Cylinder:
os << "Cylinder";
break;
case LayerType::Disc:
case Disc:
os << "Disc";
break;
case LayerType::Plane:
case Plane:
os << "Plane";
break;
}
Expand Down
4 changes: 2 additions & 2 deletions Core/include/Acts/Utilities/DelegateChainBuilder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class DelegateChainBuilder<R(callable_args...), TypeList<payload_types...>,

template <std::size_t I = 0, typename result_ptr>
static constexpr auto invoke(result_ptr result, const tuple_type* payloads,
callable_args... args) {
callable_args&&... args) {
const auto& callable = findCallable<I, 0, callables...>();

if constexpr (!std::is_same_v<std::tuple_element_t<I, tuple_type>,
Expand Down Expand Up @@ -134,7 +134,7 @@ class DelegateChainBuilder<R(callable_args...), TypeList<payload_types...>,

tuple_type m_payloads{};

auto dispatch(callable_args... args) const {
auto dispatch(callable_args&&... args) const {
if constexpr (std::is_same_v<R, void>) {
invoke(nullptr, &m_payloads, std::forward<callable_args>(args)...);
} else {
Expand Down
4 changes: 2 additions & 2 deletions Core/src/Geometry/TrackingVolume.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ TrackingVolume::TrackingVolume(const Transform3& transform,
{}, volumeName) {}

TrackingVolume::~TrackingVolume() = default;
TrackingVolume::TrackingVolume(TrackingVolume&&) = default;
TrackingVolume& TrackingVolume::operator=(TrackingVolume&&) = default;
TrackingVolume::TrackingVolume(TrackingVolume&&) noexcept = default;
TrackingVolume& TrackingVolume::operator=(TrackingVolume&&) noexcept = default;

const TrackingVolume* TrackingVolume::lowestTrackingVolume(
const GeometryContext& gctx, const Vector3& position,
Expand Down
2 changes: 0 additions & 2 deletions Core/src/Navigation/SurfaceArrayNavigationPolicy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ SurfaceArrayNavigationPolicy::SurfaceArrayNavigationPolicy(
auto [binsPhi, binsZ] = config.bins;
m_surfaceArray =
sac.surfaceArrayOnCylinder(gctx, std::move(surfaces), binsPhi, binsZ);
// m_surfaces = sac.createCylinderSurfaces(config.bins.first,
// config.bins.second);
} else if (config.layerType == LayerType::Plane) {
ACTS_ERROR("Plane layers are not yet supported");
throw std::invalid_argument("Plane layers are not yet supported");
Expand Down
4 changes: 2 additions & 2 deletions Examples/Python/src/Navigation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ struct AnyNavigationPolicyFactory : public Acts::NavigationPolicyFactory {
template <typename Factory = detail::NavigationPolicyFactoryImpl<>,
typename... Policies>
struct NavigationPolicyFactoryT : public AnyNavigationPolicyFactory {
NavigationPolicyFactoryT(Factory impl)
explicit NavigationPolicyFactoryT(Factory impl)
requires(sizeof...(Policies) > 0)
: m_impl(std::move(impl)) {}

Expand Down Expand Up @@ -74,7 +74,7 @@ struct NavigationPolicyFactoryT : public AnyNavigationPolicyFactory {
private:
template <typename T, typename... Args>
std::unique_ptr<AnyNavigationPolicyFactory> add(Args&&... args) {
if constexpr (!((std::is_same_v<T, Policies> || ...))) {
if constexpr (!(std::is_same_v<T, Policies> || ...)) {
auto impl =
std::move(m_impl).template add<T>(std::forward<Args>(args)...);
return std::make_unique<
Expand Down

0 comments on commit 371692d

Please sign in to comment.