Skip to content

Commit db869f4

Browse files
committed
[hist] Move RAxisVariant declaration
Needed in the public interface of the histogram classes, so it should not be in the Internal namespace.
1 parent da35ce0 commit db869f4

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

hist/histv7/inc/ROOT/RAxes.hxx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,29 +22,29 @@ class TBuffer;
2222

2323
namespace ROOT {
2424
namespace Experimental {
25+
26+
/// Variant of all supported axis types.
27+
using RAxisVariant = std::variant<RRegularAxis, RVariableBinAxis>;
28+
2529
namespace Internal {
2630

2731
/**
2832
Bin configurations for all dimensions of a histogram.
2933
*/
3034
class RAxes final {
31-
public:
32-
using AxisVariant = std::variant<RRegularAxis, RVariableBinAxis>;
33-
34-
private:
35-
std::vector<AxisVariant> fAxes;
35+
std::vector<RAxisVariant> fAxes;
3636

3737
public:
3838
/// \param[in] axes the axis objects, must have size > 0
39-
explicit RAxes(std::vector<AxisVariant> axes) : fAxes(std::move(axes))
39+
explicit RAxes(std::vector<RAxisVariant> axes) : fAxes(std::move(axes))
4040
{
4141
if (fAxes.empty()) {
4242
throw std::invalid_argument("must have at least 1 axis object");
4343
}
4444
}
4545

4646
std::size_t GetNDimensions() const { return fAxes.size(); }
47-
const std::vector<AxisVariant> &Get() const { return fAxes; }
47+
const std::vector<RAxisVariant> &Get() const { return fAxes; }
4848

4949
friend bool operator==(const RAxes &lhs, const RAxes &rhs) { return lhs.fAxes == rhs.fAxes; }
5050

hist/histv7/test/hist_axes.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ TEST(RAxes, Constructor)
2727
EXPECT_TRUE(std::get_if<RRegularAxis>(&v[0]) != nullptr);
2828
EXPECT_TRUE(std::get_if<RVariableBinAxis>(&v[1]) != nullptr);
2929

30-
std::vector<RAxes::AxisVariant> newAxes{variableBinAxis, regularAxis};
30+
std::vector<RAxisVariant> newAxes{variableBinAxis, regularAxis};
3131
axes = RAxes(newAxes);
3232
EXPECT_EQ(axes.GetNDimensions(), 2);
3333

hist/histv7/test/hist_test.hxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#include "gtest/gtest.h"
1111

12+
using ROOT::Experimental::RAxisVariant;
1213
using ROOT::Experimental::RBinIndex;
1314
using ROOT::Experimental::RBinIndexRange;
1415
using ROOT::Experimental::RRegularAxis;

0 commit comments

Comments
 (0)