Skip to content

Commit

Permalink
fix: Remove final on template derived classes (acts-project#3923)
Browse files Browse the repository at this point in the history
This seems to cause issues when using `dynamic_cast` on AppleClang 16 and llvm 18 on macOS 15 (at least).

Reproducer:
https://gist.github.com/paulgessinger/2c1d2abdeb322072c507878ab5833728

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **New Features**
	- Enhanced extensibility of the `GridPortalLinkT`, `Axis`, `Affine3Transformed`, `GlobalSubspace`, and `LocalSubspace` classes by allowing subclassing.
	- Updated constructors and methods in `GridPortalLinkT` to improve error handling and functionality.

- **Bug Fixes**
	- Improved validation in the `resolveVolume` method to ensure positions are within valid bounds.

- **Documentation**
	- Clarified class hierarchies and relationships due to changes in access specifiers.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
paulgessinger authored Nov 29, 2024
1 parent 6a836db commit 8895da1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Core/include/Acts/Geometry/GridPortalLink.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ class GridPortalLink : public PortalLinkBase {
/// @tparam Axes The axis types of the grid
template <typename... Axes>
requires(sizeof...(Axes) <= 2)
class GridPortalLinkT final : public GridPortalLink {
class GridPortalLinkT : public GridPortalLink {
public:
/// The internal grid type
using GridType = Grid<const TrackingVolume*, Axes...>;
Expand Down
4 changes: 2 additions & 2 deletions Core/include/Acts/Utilities/Axis.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class NeighborHoodIndices {
/// This class provides some basic functionality for calculating bin indices
/// for a given equidistant binning.
template <AxisBoundaryType bdt>
class Axis<AxisType::Equidistant, bdt> final : public IAxis {
class Axis<AxisType::Equidistant, bdt> : public IAxis {
public:
static constexpr AxisType type = AxisType::Equidistant;

Expand Down Expand Up @@ -417,7 +417,7 @@ class Axis<AxisType::Equidistant, bdt> final : public IAxis {
/// This class provides some basic functionality for calculating bin indices
/// for a given binning with variable bin sizes.
template <AxisBoundaryType bdt>
class Axis<AxisType::Variable, bdt> final : public IAxis {
class Axis<AxisType::Variable, bdt> : public IAxis {
public:
static constexpr AxisType type = AxisType::Variable;

Expand Down
6 changes: 3 additions & 3 deletions Core/include/Acts/Utilities/GridAccessHelpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class IBoundToGridLocal {
};

template <typename global_to_grid_local_t>
class Affine3Transformed final : public IGlobalToGridLocal {
class Affine3Transformed : public IGlobalToGridLocal {
public:
using grid_local_t = typename global_to_grid_local_t::grid_local_t;

Expand Down Expand Up @@ -142,7 +142,7 @@ class Affine3Transformed final : public IGlobalToGridLocal {
/// position
/// @tparam ...Args
template <BinningValue... Args>
class GlobalSubspace final : public IGlobalToGridLocal {
class GlobalSubspace : public IGlobalToGridLocal {
public:
using grid_local_t = std::array<double, sizeof...(Args)>;

Expand Down Expand Up @@ -179,7 +179,7 @@ class GlobalSubspace final : public IGlobalToGridLocal {
// The bound to grid local transformation, if only access of a subspace
// is requested
template <std::size_t... Args>
class LocalSubspace final : public IBoundToGridLocal {
class LocalSubspace : public IBoundToGridLocal {
public:
using grid_local_t = std::array<double, sizeof...(Args)>;

Expand Down

0 comments on commit 8895da1

Please sign in to comment.