xaxis_function

Defined in xframe/xaxis_function.hpp

template<class F, class R, class ...CT>
class xaxis_function : public xt::xexpression<xaxis_function<F, R, CT...>>

An expression of xaxis.

The xaxis_function class is used for creating an expression on named axis, e.g. auto expr = not_equal(axis1, 2) && axis2 < 2.

See

xaxis_expression_leaf

See

xnamed_axis

Template Parameters
  • F: the function type.

  • R: the result type.

  • CT: the function argument types.

Public Functions

template<class Func, class U = std::enable_if<!std::is_base_of<Func, self_type>::value>>
xaxis_function(Func &&f, CT... e)

Builds an axis function.

Parameters
  • f: the function to apply.

  • e: the function arguments.

template<std::size_t N>
auto operator()(const selector_sequence_type<N> &selector) const

Returns an evaluation of the xaxis_function.

Example:

auto axis1 = named_axis("abs", axis(16));
auto axis2 = named_axis("ord", axis({'a', 'c', 'i'}));

auto func1 = axis1 < 5 && not_equal(axis2, 'i');

// This will evaluate the xaxis_function for `axis1.label(10) == 9` and `axis2.label(1) == 'c'``
func1({{"abs", 10}, {"ord", 1}});

Return

the evaluation of the xaxis_function

Parameters
  • selector: a selector_sequence_type for selecting the position where you want to evaluate the function.