2019-05-28 16:46:55 +00:00
|
|
|
#include "headers/Park_spot.h"
|
2019-06-25 00:42:08 +00:00
|
|
|
#include "headers/db.h"
|
2019-05-28 16:46:55 +00:00
|
|
|
#include <iostream>
|
|
|
|
#include <thread> // to make pausing work, not sure if i need chrono, or this, or both
|
|
|
|
#include <vector>
|
|
|
|
|
2019-06-20 11:08:02 +00:00
|
|
|
/*
|
|
|
|
Code strucure like this:
|
2019-06-25 00:42:08 +00:00
|
|
|
class declarations zijn in /headers/class_naam.h, en definitions van de member
|
|
|
|
functs in /class_naam.cpp elke klas in zn eigen file omdat ik incomplete class
|
|
|
|
declarations wilt tegengaan, omdat ik ze niet goed begrijp. En header/source
|
|
|
|
split om multiple definition errors tegen te gaan.
|
2019-06-20 11:08:02 +00:00
|
|
|
|
|
|
|
Park_spot representeert een parkeermeter bij elke parkeer spot.
|
2019-06-25 00:42:08 +00:00
|
|
|
Een customer is een customer.
|
|
|
|
Park time is een object die reffereert naar parkspot en customer, basically een
|
|
|
|
record die zegt dat een customer voor x tijd geparkeert heeft bij spot x, enz.
|
2019-06-20 11:08:02 +00:00
|
|
|
|
2019-06-25 00:42:08 +00:00
|
|
|
De client clockt in en uit bij een spot.
|
2019-06-20 11:08:02 +00:00
|
|
|
*/
|
|
|
|
|
2019-05-28 16:46:55 +00:00
|
|
|
void Wait(int sec)
|
2019-06-20 11:08:02 +00:00
|
|
|
/*
|
|
|
|
a wait function where 1 sec represents 1 hour irl.
|
|
|
|
*/
|
2019-05-28 16:46:55 +00:00
|
|
|
{
|
2019-06-25 00:42:08 +00:00
|
|
|
std::this_thread::sleep_for(seconds{sec});
|
2019-05-28 16:46:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
using std::cout;
|
|
|
|
|
2019-06-25 00:42:08 +00:00
|
|
|
int main() {
|
|
|
|
|
|
|
|
// test
|
|
|
|
sqlite3* db;
|
2019-06-26 09:40:43 +00:00
|
|
|
|
|
|
|
// opening the db. somehow, this does not work when placing inside a function. HALP
|
|
|
|
|
|
|
|
int status = sqlite3_open("database.sqlite", &db); // TODO: Name this better. works like main() in unix.
|
|
|
|
if (status) {
|
|
|
|
std::cout << "Can't open database: " << sqlite3_errmsg(db) << "\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO: edit function to check if any of the table exists before creating them
|
|
|
|
// or a simple file that gets saved on first run, and the function checks if that
|
|
|
|
// file exists to determine if it should create tables or not.
|
2019-06-25 00:42:08 +00:00
|
|
|
data::initialize_db(db);
|
|
|
|
sqlite3_close(db);
|
2019-06-26 09:40:43 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
Creates tables, library seems to work so far.
|
|
|
|
Gonnay try using another library. This one works,but seems a bit of a pain
|
|
|
|
especially since it seems to be using c-style 'not modern' cpp */
|
2019-06-25 00:42:08 +00:00
|
|
|
}
|