26 #ifndef DOXYGEN_SHOULD_SKIP_THIS 33 template <
template<
typename>
class ALLOC>
36 const DBRowGeneratorSet<ALLOC>& generator_set,
39 , __generator_set(generator_set, alloc)
40 , __generator_size ( generator_set.size () ) {
46 template <
template<
typename>
class ALLOC>
48 const DBRowGeneratorParser<ALLOC>& from,
58 template <
template<
typename>
class ALLOC>
60 const DBRowGeneratorParser<ALLOC>& from)
65 template <
template<
typename>
class ALLOC>
67 DBRowGeneratorParser<ALLOC>&& from,
77 template <
template<
typename>
class ALLOC>
79 DBRowGeneratorParser<ALLOC>&& from)
84 template <
template<
typename>
class ALLOC>
87 ALLOC<DBRowGeneratorParser<ALLOC>> allocator ( alloc );
88 DBRowGeneratorParser<ALLOC>* new_parser = allocator.allocate(1);
90 allocator.construct ( new_parser, *
this, alloc );
93 allocator.deallocate ( new_parser, 1 );
101 template <
template<
typename>
class ALLOC>
102 INLINE DBRowGeneratorParser<ALLOC>*
109 template <
template<
typename>
class ALLOC>
116 template <
template<
typename>
class ALLOC>
117 INLINE DBRowGeneratorParser<ALLOC>&
119 const DBRowGeneratorParser<ALLOC>& from) {
130 template <
template<
typename>
class ALLOC>
131 INLINE DBRowGeneratorParser<ALLOC>&
143 template <
template<
typename>
class ALLOC>
148 if ( !
__handler.hasRows () )
return false;
157 template <
template<
typename>
class ALLOC>
158 INLINE
const DBRow<DBTranslatedValue,ALLOC>&
174 template <
template<
typename>
class ALLOC>
182 template <
template<
typename>
class ALLOC>
190 template <
template<
typename>
class ALLOC>
198 template <
template<
typename>
class ALLOC>
199 INLINE
const DatabaseTable< ALLOC >&
201 return static_cast<const DatabaseTable< ALLOC >&
> 207 template <
template<
typename>
class ALLOC>
208 INLINE DBRowGeneratorSet<ALLOC>&
215 template <
template<
typename>
class ALLOC>
223 template <
template<
typename>
class ALLOC>
224 INLINE
const DBRowGeneratorSet<ALLOC>&
232 template <
template<
typename>
class ALLOC>
234 const std::vector<std::size_t,ALLOC<std::size_t>>& cols_of_interest ) {
241 template <
template<
typename>
class ALLOC>
243 std::vector<std::size_t,ALLOC<std::size_t>>&& cols_of_interest ) {
244 __generator_set.setColumnsOfInterest ( std::move ( cols_of_interest ) );
249 template <
template<
typename>
class ALLOC>
250 template <
typename GUM_SCALAR >
252 const BayesNet<GUM_SCALAR>& new_bn) {
258 template <
template<
typename>
class ALLOC>
DatabaseTable< ALLOC >::Handler & handler()
returns the handler used by the parser
std::size_t __generator_size
the size of the generator set
virtual DBRowGeneratorParser< ALLOC > * clone() const
virtual copy constructor
void setBayesNet(const BayesNet< GUM_SCALAR > &new_bn)
assign a new Bayes net to all the generators that depend on a BN
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
DBRowGeneratorParser< ALLOC > & operator=(const DBRowGeneratorParser< ALLOC > &from)
copy operator
void setColumnsOfInterest(const std::vector< std::size_t, ALLOC< std::size_t >> &cols_of_interest)
sets the columns of interest: the output DBRow needs only contain values fot these columns ...
typename IDatabaseTable< DBTranslatedValue, ALLOC >::Handler Handler
the unsafe handler type
allocator_type getAllocator() const
returns the allocator used
virtual ~DBRowGeneratorParser()
destructor
const DBRow< DBTranslatedValue, ALLOC > & row()
returns a new output row with its corresponding weight
bool hasRows()
returns true if there are still rows that can be output by the DBRowGeneratorParser ...
DBRowGeneratorSet< ALLOC > & generatorSet()
returns the generator set that is actually used
const DatabaseTable< ALLOC > & database() const
returns a reference on the database
ALLOC< DBTranslatedValue > allocator_type
type for the allocators passed in arguments of methods
DBRowGeneratorSet< ALLOC > __generator_set
the set of DBRow generators (might be empty)
void reset()
resets the parser
void setRange(std::size_t begin, std::size_t end)
sets the area in the database the handler will handle
DBRowGeneratorParser(const typename DatabaseTable< ALLOC >::Handler &handler, const DBRowGeneratorSet< ALLOC > &generator_set, const allocator_type &alloc=allocator_type())
default constructor
DatabaseTable< ALLOC >::Handler __handler
the handler that is really used to parse the database