mageec
0.1.0
MAchine Guided Energy Efficient Compilation
|
MAGEEC Machine Learner Database. More...
#include <mageec-db.h>
Public Member Functions | |
database (std::string dbname, bool create) | |
Creates a new database, loading from the SQlite3 database dbname. More... | |
~database () | |
int | initdb () |
Given a new database, initilize it with the MAGEEC tables. More... | |
std::vector< mageec_pass * > | get_pass_list () |
Loads known passes from the database. More... | |
std::vector< result > | get_all_results () |
Loads all results from the table. More... | |
void | add_result (result res) |
Adds a result object to the database. More... | |
void | store_pass_blob (std::string passname, char *blob) |
Stores a text string against a pass name. More... | |
const char * | get_pass_blob (std::string passname) |
Returns a text string stored against a pass name. More... | |
MAGEEC Machine Learner Database.
Definition at line 32 of file mageec-db.h.
database::database | ( | std::string | dbname, |
bool | create | ||
) |
Creates a new database, loading from the SQlite3 database dbname.
dbname | Path to database. |
create | Attempt to create the database if it does not exist. |
Definition at line 31 of file database.cpp.
database::~database | ( | ) |
Definition at line 51 of file database.cpp.
void database::add_result | ( | result | res) |
Adds a result object to the database.
res | Test result to store |
Definition at line 133 of file database.cpp.
std::vector< result > database::get_all_results | ( | ) |
Loads all results from the table.
Definition at line 186 of file database.cpp.
const char * database::get_pass_blob | ( | std::string | passname) |
Returns a text string stored against a pass name.
It is up to the caller to free this pointer.
passname | Name of pass. |
Definition at line 282 of file database.cpp.
std::vector< mageec_pass * > database::get_pass_list | ( | ) |
Loads known passes from the database.
Definition at line 101 of file database.cpp.
int database::initdb | ( | ) |
Given a new database, initilize it with the MAGEEC tables.
Definition at line 61 of file database.cpp.
void database::store_pass_blob | ( | std::string | passname, |
char * | blob | ||
) |
Stores a text string against a pass name.
If a string already exists in the database for a pass it will be replaced with blob.
passname | Name of pass. |
blob | Data to store |
Definition at line 267 of file database.cpp.