5#ifndef ROOT_RAxisVariant
6#define ROOT_RAxisVariant
24namespace Experimental {
36 using VariantType = std::variant<RRegularAxis, RVariableBinAxis, RCategoricalAxis>;
59 return regular->GetNNormalBins();
61 return variable->GetNNormalBins();
63 return categorical->GetNNormalBins();
65 throw std::logic_error(
"unimplemented axis type");
72 return regular->GetTotalNBins();
74 return variable->GetTotalNBins();
76 return categorical->GetTotalNBins();
78 throw std::logic_error(
"unimplemented axis type");
87 linIndex = regular->GetLinearizedIndex(
index);
89 linIndex = variable->GetLinearizedIndex(
index);
91 linIndex = categorical->GetLinearizedIndex(
index);
93 throw std::logic_error(
"unimplemented axis type");
104 return regular->GetNormalRange();
106 return variable->GetNormalRange();
108 return categorical->GetNormalRange();
110 throw std::logic_error(
"unimplemented axis type");
122 return regular->GetNormalRange(begin, end);
124 return variable->GetNormalRange(begin, end);
126 return categorical->GetNormalRange(begin, end);
128 throw std::logic_error(
"unimplemented axis type");
140 return regular->GetFullRange();
142 return variable->GetFullRange();
144 return categorical->GetFullRange();
146 throw std::logic_error(
"unimplemented axis type");
160 return regular->
Slice(sliceSpec);
162 return variable->
Slice(sliceSpec);
164 return categorical->
Slice(sliceSpec);
166 throw std::logic_error(
"unimplemented axis type");
173 void Streamer(
TBuffer &) {
throw std::runtime_error(
"unable to store RAxisVariant"); }
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
A variant of all supported axis types.
RAxisVariant(RCategoricalAxis axis)
friend bool operator==(const RAxisVariant &lhs, const RAxisVariant &rhs)
RAxisVariant(VariantType axis)
RBinIndexRange GetNormalRange(RBinIndex begin, RBinIndex end) const
Get a range of normal bins.
RBinIndexRange GetFullRange() const
Get the full range of all bins.
std::uint64_t GetNNormalBins() const
RAxisVariant(RVariableBinAxis axis)
void Streamer(TBuffer &)
ROOT Streamer function to throw when trying to store an object of this class.
const VariantType & GetVariant() const
bool IsValidIndex(RBinIndex index) const
const RRegularAxis * GetRegularAxis() const
const RVariableBinAxis * GetVariableBinAxis() const
std::uint64_t GetTotalNBins() const
std::variant< RRegularAxis, RVariableBinAxis, RCategoricalAxis > VariantType
RBinIndexRange GetNormalRange() const
Get the range of all normal bins.
RAxisVariant(RRegularAxis axis)
RAxisVariant Slice(const RSliceSpec &sliceSpec) const
Slice this axis according to the specification.
const RCategoricalAxis * GetCategoricalAxis() const
A bin index with special values for underflow and overflow bins.
An axis with categorical bins.
A regular axis with equidistant bins in the interval .
Specification of a slice operation along one dimension.
An axis with variable bins defined by their edges.
Buffer base class used for serializing objects.
A linearized index that can be invalid.