45#ifndef DOXYGEN_SHOULD_SKIP_THIS
58 _generators_(std::move(from._generators_)), _nb_generators_(from._nb_generators_),
59 _output_row_(from._output_row_),
60 _setInputRow_performed_(std::move(from._setInputRow_performed_)) {
61 GUM_CONS_MOV(DBRowGeneratorSet);
65 INLINE DBRowGenerator& DBRowGeneratorSet::operator[](
const std::size_t i) {
66 return *(_generators_[i]);
70 INLINE
const DBRowGenerator& DBRowGeneratorSet::operator[](
const std::size_t i)
const {
71 return *(_generators_[i]);
75 INLINE std::size_t DBRowGeneratorSet::nbGenerators() const noexcept {
return _nb_generators_; }
78 INLINE std::size_t DBRowGeneratorSet::size() const noexcept {
return _nb_generators_; }
81 INLINE
bool DBRowGeneratorSet::hasRows() {
return _output_row_ !=
nullptr; }
84 INLINE
bool DBRowGeneratorSet::setInputRow(
const DBRow< DBTranslatedValue >& input_row) {
87 for (
auto& performed: _setInputRow_performed_)
91 return _produceNextRow_(&input_row, std::size_t(0));
95 INLINE
const DBRow< DBTranslatedValue >& DBRowGeneratorSet::generate() {
97 const auto row = _output_row_;
100 _produceNextRow_(_output_row_, _nb_generators_ - 1);
106 INLINE
void DBRowGeneratorSet::reset() {
107 for (
auto gen: _generators_)
109 for (
auto& performed: _setInputRow_performed_)
111 _output_row_ =
nullptr;
116 INLINE
void DBRowGeneratorSet::setColumnsOfInterest(
117 const std::vector< std::size_t >& cols_of_interest) {
119 if (_output_row_ !=
nullptr)
121 "you cannot change the columns of interest while a "
122 "generation is still being processed");
123 for (
auto gen: _generators_)
124 gen->setColumnsOfInterest(cols_of_interest);
130 DBRowGeneratorSet::setColumnsOfInterest(std::vector< std::size_t >&& cols_of_interest) {
131 if (_output_row_ !=
nullptr)
133 "you cannot change the columns of interest while a "
134 "generation is still being processed");
135 for (
auto gen: _generators_)
136 gen->setColumnsOfInterest(cols_of_interest);
140 INLINE
const std::vector< std::size_t >& DBRowGeneratorSet::columnsOfInterest()
const {
141 if (_nb_generators_ == std::size_t(0)) {
143 "there are no generators yet in the generator set, so "
144 "there are no columns of interest");
146 return _generators_[0]->columnsOfInterest();
class for packing sets of generators
Exception : operation not allowed.
Exception : a looked-for element could not be found.
The class used to pack sets of generators.
DBRowGeneratorSet()
default constructor
#define GUM_ERROR(type, msg)
include the inlined functions if necessary
gum is the global namespace for all aGrUM entities