1 #ifndef GENESIS_POPULATION_FILTER_FILTER_STATS_H_
2 #define GENESIS_POPULATION_FILTER_FILTER_STATS_H_
39 #include <type_traits>
42 namespace population {
60 template<
typename FilterTag>
67 using FilterTagArray = std::array<size_t, static_cast<size_t>( FilterTag::kEnd )>;
84 auto const i =
static_cast<typename std::underlying_type<FilterTag>::type
>(tag);
85 if( i >=
data.size() ) {
86 throw std::invalid_argument(
"Invalid filter tag value " +
std::to_string(i) );
93 auto const i =
static_cast<typename std::underlying_type<FilterTag>::type
>(tag);
94 if( i >=
data.size() ) {
95 throw std::invalid_argument(
"Invalid filter tag value " +
std::to_string(i) );
102 if( index >=
data.size() ) {
103 throw std::invalid_argument(
"Invalid filter tag value " +
std::to_string(index) );
105 return data[ index ];
110 if( index >=
data.size() ) {
111 throw std::invalid_argument(
"Invalid filter tag value " +
std::to_string(index) );
113 return data[ index ];
116 typename FilterTagArray::iterator
begin()
121 typename FilterTagArray::const_iterator
begin()
const
126 typename FilterTagArray::iterator
end()
131 typename FilterTagArray::const_iterator
end()
const
148 for(
auto v :
data ) {
158 static_cast<typename std::underlying_type<FilterTag>::type
>(FilterTag::kPassed) == 0,
159 "Filter Tag enum value kPassed != 0"
164 for(
size_t i = 1; i <
data.size(); ++i ) {
190 #endif // include guard