57 lines
2.2 KiB
C++
57 lines
2.2 KiB
C++
|
|
#include "headers/bigheader.h"
|
|
|
|
/*
|
|
Code structure is like this:
|
|
1. encrypt.cpp en /header/encrypt.h contain functions to hash passwords and
|
|
verify passwords
|
|
|
|
2. data.cpp and /header/data.h contain the code to start up the database.
|
|
Originally, they were supposed to contain all the functions to save to the
|
|
database and query from the database. But there were issues, and we did stuff
|
|
in the meantime. Most of the original problems that prevented
|
|
that are fixed with the latest refactor, but it would take a bit of time to
|
|
place the functions there and test that they do what they do.
|
|
The functions to save to a database have been integrated in the classes
|
|
themself, and unless issues arrise from that I'm not changing that. Functions to
|
|
get objects from the database are in Query.cpp en header.
|
|
|
|
3. Park_time.cpp en header.
|
|
Contain the implementation details of Park_time, which is basically a record of
|
|
who parked at what spot and when. Uses a mix of ctime and chrono functions to do
|
|
most of the stuff, it's a mess. I will probably have to commit to Doing it one
|
|
way or the other to make it more comperhensible, especially for whoever will
|
|
make report functions.
|
|
|
|
4. Customer.cpp and header.
|
|
Contains the implementation of Customer. Customer represents a customer, and
|
|
saves park_time instances in itself. Not much to explain.
|
|
|
|
5. Park_spot.cpp and header.
|
|
It contians the implementation details of Park_spot, which represents it's
|
|
namesake.
|
|
|
|
6. Query.cpp and header.
|
|
Cointain functions that search the database and return objects(P_time, P_spot,
|
|
Customer) It is the least tested of the whole project, use with care.
|
|
|
|
7.Interface.cpp and header
|
|
contain all the functions needed to have an interface that's seen when the program is
|
|
running.
|
|
|
|
Explanation of what members do of P_time, P_spot, Customer are in the respective
|
|
headers. Explanations of how the member functions work(Or how we intended for
|
|
them to work) are in the respective .cpp files.
|
|
*/
|
|
|
|
static vector<Park_spot> parking_spots = populate_spots();
|
|
// this queries the db for all the saved parking_spots and initializes them
|
|
static vector<Customer> park_customers;
|
|
|
|
int main() {
|
|
|
|
while (true) {
|
|
interface(parking_spots);
|
|
}
|
|
}
|