![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
The base class for initializing DatabaseTable and RawDatabaseTable instances from CSV files or SQL databases. More...
#include <agrum/base/database/IDBInitializer.h>
Public Types | |
| enum class | InputType : char { STRING , DBCELL } |
| the enumeration indicating the type of the data the IDBInitializer expects as input data More... | |
Public Member Functions | |
Constructors / Destructors | |
| IDBInitializer (const InputType type) | |
| default constructor | |
| IDBInitializer (const IDBInitializer &from) | |
| copy constructor | |
| IDBInitializer (IDBInitializer &&from) | |
| move constructor | |
| virtual IDBInitializer * | clone () const =0 |
| virtual copy constructor | |
| virtual | ~IDBInitializer () |
| destructor | |
Accessors / Modifiers | |
| const std::vector< std::string > & | variableNames () |
| returns the names of the variables in the input dataset | |
| template<class DATABASE> | |
| void | fillDatabase (DATABASE &database, const bool retry_insertion=false) |
| fills the rows of the database table | |
| std::size_t | throwingColumn () const |
| This method indicates which column filling raised an exception, if any, during the execution of fillDatabase. | |
Protected Member Functions | |
| IDBInitializer & | operator= (const IDBInitializer &from) |
| copy operator | |
| IDBInitializer & | operator= (IDBInitializer &&from) |
| move operator | |
| virtual std::vector< std::string > | variableNames_ ()=0 |
| ask the child class for the names of the variables | |
| virtual const std::vector< std::string > & | currentStringRow_ () |
| asks the child class for the content of the current row using strings | |
| virtual const DBRow< DBCell > & | currentDBCellRow_ () |
| asks the child class for the content of the current row using dbcells | |
| virtual bool | nextRow_ ()=0 |
| indicates whether there is a next row to read (and point on it) | |
The base class for initializing DatabaseTable and RawDatabaseTable instances from CSV files or SQL databases.
Definition at line 135 of file IDBInitializer.h.
|
strong |
the enumeration indicating the type of the data the IDBInitializer expects as input data
| Enumerator | |
|---|---|
| STRING | |
| DBCELL | |
Definition at line 139 of file IDBInitializer.h.
| gum::learning::IDBInitializer::IDBInitializer | ( | const InputType | type | ) |
default constructor
| type | indicates what type of data will be read by the IDBInitializer when it will try to fill the database. |
Referenced by IDBInitializer(), IDBInitializer(), clone(), operator=(), and operator=().
| gum::learning::IDBInitializer::IDBInitializer | ( | const IDBInitializer & | from | ) |
| gum::learning::IDBInitializer::IDBInitializer | ( | IDBInitializer && | from | ) |
|
virtual |
destructor
|
pure virtual |
virtual copy constructor
Implemented in gum::learning::DBInitializerFromCSV, and gum::learning::DBInitializerFromSQL.
References IDBInitializer().
|
protectedvirtual |
asks the child class for the content of the current row using dbcells
If the child class parses DBRows, this method should be overloaded
|
protectedvirtual |
asks the child class for the content of the current row using strings
If the child class parses strings, this method should be overloaded
Reimplemented in gum::learning::DBInitializerFromCSV, and gum::learning::DBInitializerFromSQL.
| void gum::learning::IDBInitializer::fillDatabase | ( | DATABASE & | database, |
| const bool | retry_insertion = false ) |
fills the rows of the database table
This method may raise exceptions when trying to insert new rows into the database table. See Method insertRow() of the database table.
Referenced by gum::learning::IBNLearner::Database::Database(), gum::learning::IBNLearner::Database::Database(), gum::learning::readFile(), and gum::learning::IBNLearner::readFile_().
|
protectedpure virtual |
indicates whether there is a next row to read (and point on it)
Implemented in gum::learning::DBInitializerFromCSV, and gum::learning::DBInitializerFromSQL.
|
protected |
|
protected |
| std::size_t gum::learning::IDBInitializer::throwingColumn | ( | ) | const |
This method indicates which column filling raised an exception, if any, during the execution of fillDatabase.
| const std::vector< std::string > & gum::learning::IDBInitializer::variableNames | ( | ) |
returns the names of the variables in the input dataset
Referenced by gum::learning::IBNLearner::Database::Database(), gum::learning::IBNLearner::Database::Database(), gum::learning::readFile(), and gum::learning::IBNLearner::readFile_().
|
protectedpure virtual |
ask the child class for the names of the variables
Implemented in gum::learning::DBInitializerFromCSV, and gum::learning::DBInitializerFromSQL.