29 #ifndef DOXYGEN_SHOULD_SKIP_THIS 37 template <
template <
typename >
class ALLOC >
40 return __var_names.get_allocator();
45 template <
template <
typename >
class ALLOC >
56 template <
template <
typename >
class ALLOC >
58 const IDBInitializer< ALLOC >& from,
60 __var_names(from.__var_names, alloc),
61 __input_type(from.__input_type) {
67 template <
template <
typename >
class ALLOC >
69 const IDBInitializer< ALLOC >& from) :
74 template <
template <
typename >
class ALLOC >
76 IDBInitializer< ALLOC >&& from,
78 __var_names(
std::move(from.__var_names), alloc),
79 __input_type(from.__input_type) {
85 template <
template <
typename >
class ALLOC >
92 template <
template <
typename >
class ALLOC >
99 template <
template <
typename >
class ALLOC >
100 const std::vector< std::string, ALLOC< std::string > >&
108 template <
template <
typename >
class ALLOC >
110 operator=(
const IDBInitializer< ALLOC >& from) {
112 __var_names = from.__var_names;
113 __input_type = from.__input_type;
114 __last_insertion_failed =
false;
121 template <
template <
typename >
class ALLOC >
123 operator=(IDBInitializer< ALLOC >&& from) {
125 __var_names = std::move(from.__var_names);
126 __input_type = from.__input_type;
127 __last_insertion_failed =
false;
134 template <
template <
typename >
class ALLOC >
135 template <
template <
template <
typename >
class >
class DATABASE >
137 const bool retry_insertion) {
138 switch (__input_type) {
140 __fillDatabaseFromStrings(database, retry_insertion);
144 __fillDatabaseFromDBCells(database, retry_insertion);
149 "fillDatabase has not been implemented yet for this " 150 "type of IDBInitializerInputType");
156 template <
template <
typename >
class ALLOC >
157 template <
template <
template <
typename >
class >
class DATABASE >
159 DATABASE< ALLOC >& database, const bool retry_insertion) {
161 if (retry_insertion && __last_insertion_failed) {
163 __last_insertion_failed =
false;
172 __last_insertion_failed =
true;
180 template <
template <
typename >
class ALLOC >
181 template <
template <
template <
typename >
class >
class DATABASE >
183 DATABASE< ALLOC >& database, const bool retry_insertion) {
185 if (retry_insertion && __last_insertion_failed) {
187 __last_insertion_failed =
false;
196 __last_insertion_failed =
true;
204 template <
template <
typename >
class ALLOC >
205 const std::vector< std::string, ALLOC< std::string > >&
208 "Method _currentStringRow should not be used or it should be " 209 "overloaded in children classes.");
214 template <
template <
typename >
class ALLOC >
217 "Method _currentDBCellRow should not be used or it should be " 218 "overloaded in children classes.");
const std::vector< std::string, ALLOC< std::string > > & variableNames()
returns the names of the variables in the input dataset
virtual std::vector< std::string, ALLOC< std::string > > _variableNames()=0
ask the child class for the names of the variables
virtual const DBRow< DBCell, ALLOC > & _currentDBCellRow()
asks the child class for the content of the current row using dbcells
allocator_type getAllocator() const
returns the allocator used
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
IDBInitializer< ALLOC > & operator=(const IDBInitializer< ALLOC > &from)
copy operator
void fillDatabase(DATABASE< ALLOC > &database, const bool retry_insertion=false)
fills the rows of the database table
InputType
the enumeration indicating the type of the data the IDBInitializer expects as input data ...
virtual bool _nextRow()=0
indicates whether there is a next row to read (and point on it)
ALLOC< std::string > allocator_type
type for the allocators passed in arguments of methods
virtual const std::vector< std::string, ALLOC< std::string > > & _currentStringRow()
asks the child class for the content of the current row using strings
IDBInitializer(const InputType type, const allocator_type &alloc)
default constructor
virtual ~IDBInitializer()
destructor
#define GUM_ERROR(type, msg)