move reduce_command into separate header

This commit is contained in:
Hans Dembinski 2020-03-10 18:47:51 +01:00 committed by GitHub
parent 82a22250aa
commit 38d9118c29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 41 additions and 26 deletions

View File

@ -11,6 +11,7 @@
#include <boost/histogram/axis/traits.hpp>
#include <boost/histogram/detail/axes.hpp>
#include <boost/histogram/detail/make_default.hpp>
#include <boost/histogram/detail/reduce_command.hpp>
#include <boost/histogram/detail/static_if.hpp>
#include <boost/histogram/fwd.hpp>
#include <boost/histogram/indexed.hpp>
@ -23,32 +24,6 @@
namespace boost {
namespace histogram {
namespace detail {
struct reduce_command {
static constexpr unsigned unset = static_cast<unsigned>(-1);
unsigned iaxis;
enum class range_t : char {
none,
indices,
values,
} range = range_t::none;
union {
axis::index_type index;
double value;
} begin;
union {
axis::index_type index;
double value;
} end;
unsigned merge = 0; // default value indicates unset option
bool crop = false;
// for internal use by the reduce algorithm
bool is_ordered = true;
bool use_underflow_bin = true;
bool use_overflow_bin = true;
};
} // namespace detail
namespace algorithm {
/** Holder for a reduce command.

View File

@ -0,0 +1,40 @@
// Copyright 2020 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt
// or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_HISTOGRAM_DETAIL_REDUCE_COMMAND_HPP
#define BOOST_HISTOGRAM_DETAIL_REDUCE_COMMAND_HPP
#include <boost/histogram/fwd.hpp>
namespace boost {
namespace histogram {
namespace detail {
struct reduce_command {
static constexpr unsigned unset = static_cast<unsigned>(-1);
unsigned iaxis;
enum class range_t : char {
none,
indices,
values,
} range = range_t::none;
union {
axis::index_type index;
double value;
} begin, end;
unsigned merge = 0; // default value indicates unset option
bool crop = false;
// for internal use by the reduce algorithm
bool is_ordered = true;
bool use_underflow_bin = true;
bool use_overflow_bin = true;
};
} // namespace detail
} // namespace histogram
} // namespace boost
#endif