Parkmanne/headers/Query.h
2019-07-23 11:17:55 -03:00

43 lines
1.4 KiB
C++

#ifndef QUERY_H
#define QUERY_H
#pragma once
#include "Park_spot.h"
#include <iomanip>
using std::pair;
/*these are the functions that search the database and create objects from it.
query_parktimes_for_customer searches for the parktimes that are needed in
customer initialisaiton. generally, i see no use outside of that.
query_customer_with_name searches for customer data by name.
NOTE: query_customer_with_name has been removed, nothing is using it
query_customer_with_id does what the above does, but with id.
query_parkspot_with_id does what the above do, but with a vector and not to the db.
populate_spots is used to query for all the park_spots in db and return them in a vector.
We can keep that in memory to reduce calls to the db, but increasing the memory footprint of this
program
reports_from_x functions query the db for parktimes with various conditions
current_status_parkspots takes in a vector and outputs the status of them
*/
vector<Park_time> query_parktimes_for_customer(int cid);
Customer query_customer_with_id(int id);
Park_spot query_parkspot_with_id(int id, vector<Park_spot>& parkspots);
int query_role_customer(int id);
vector<Park_spot> populate_spots();
void reports_from_parkspot(int spotid, pair<int, int> period);
void reports_from_allparkspots(pair<int, int> period);
void current_status_parkspots(vector<Park_spot>& spots);
vector<Park_time> reports_from_customer(int cid, pair<int, int> period);
#endif // CUSTOMER_H