26 #ifndef DOXYGEN_SHOULD_SKIP_THIS 34 template <
template <
typename >
class ALLOC >
37 return __var_names.get_allocator();
42 template <
template <
typename >
class ALLOC >
53 template <
template <
typename >
class ALLOC >
55 const IDBInitializer< ALLOC >& from,
57 __var_names(from.__var_names, alloc),
58 __input_type(from.__input_type) {
64 template <
template <
typename >
class ALLOC >
66 const IDBInitializer< ALLOC >& from) :
71 template <
template <
typename >
class ALLOC >
73 IDBInitializer< ALLOC >&& from,
75 __var_names(
std::move(from.__var_names), alloc),
76 __input_type(from.__input_type) {
82 template <
template <
typename >
class ALLOC >
89 template <
template <
typename >
class ALLOC >
96 template <
template <
typename >
class ALLOC >
97 const std::vector< std::string, ALLOC< std::string > >&
105 template <
template <
typename >
class ALLOC >
107 operator=(
const IDBInitializer< ALLOC >& from) {
109 __var_names = from.__var_names;
110 __input_type = from.__input_type;
111 __last_insertion_failed =
false;
118 template <
template <
typename >
class ALLOC >
120 operator=(IDBInitializer< ALLOC >&& from) {
122 __var_names = std::move(from.__var_names);
123 __input_type = from.__input_type;
124 __last_insertion_failed =
false;
131 template <
template <
typename >
class ALLOC >
132 template <
template <
template <
typename >
class >
class DATABASE >
134 const bool retry_insertion) {
135 switch (__input_type) {
137 __fillDatabaseFromStrings(database, retry_insertion);
141 __fillDatabaseFromDBCells(database, retry_insertion);
146 "fillDatabase has not been implemented yet for this " 147 "type of IDBInitializerInputType");
153 template <
template <
typename >
class ALLOC >
154 template <
template <
template <
typename >
class >
class DATABASE >
156 DATABASE< ALLOC >& database, const bool retry_insertion) {
158 if (retry_insertion && __last_insertion_failed) {
160 __last_insertion_failed =
false;
169 __last_insertion_failed =
true;
177 template <
template <
typename >
class ALLOC >
178 template <
template <
template <
typename >
class >
class DATABASE >
180 DATABASE< ALLOC >& database, const bool retry_insertion) {
182 if (retry_insertion && __last_insertion_failed) {
184 __last_insertion_failed =
false;
193 __last_insertion_failed =
true;
201 template <
template <
typename >
class ALLOC >
202 const std::vector< std::string, ALLOC< std::string > >&
205 "Method _currentStringRow should not be used or it should be " 206 "overloaded in children classes.");
211 template <
template <
typename >
class ALLOC >
214 "Method _currentDBCellRow should not be used or it should be " 215 "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
gum is the global namespace for all aGrUM entities
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)