Parkmanne/headers/Query.h

43 lines
1.4 KiB
C
Raw Permalink Normal View History

2019-07-02 00:51:23 +00:00
#ifndef QUERY_H
#define QUERY_H
#pragma once
#include "Park_spot.h"
2019-07-23 14:17:55 +00:00
#include <iomanip>
2019-07-20 13:33:19 +00:00
using std::pair;
2019-07-02 00:51:23 +00:00
2019-07-02 18:40:37 +00:00
/*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.
2019-07-23 14:17:55 +00:00
NOTE: query_customer_with_name has been removed, nothing is using it
2019-07-02 18:40:37 +00:00
query_customer_with_id does what the above does, but with id.
2019-07-23 14:17:55 +00:00
query_parkspot_with_id does what the above do, but with a vector and not to the db.
2019-07-02 18:40:37 +00:00
2019-07-23 14:17:55 +00:00
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
2019-07-02 18:40:37 +00:00
2019-07-23 14:17:55 +00:00
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
2019-07-02 18:40:37 +00:00
*/
2019-07-02 00:51:23 +00:00
vector<Park_time> query_parktimes_for_customer(int cid);
Customer query_customer_with_id(int id);
2019-07-06 16:32:00 +00:00
Park_spot query_parkspot_with_id(int id, vector<Park_spot>& parkspots);
int query_role_customer(int id);
2019-07-06 16:32:00 +00:00
vector<Park_spot> populate_spots();
2019-07-20 23:32:47 +00:00
void reports_from_parkspot(int spotid, pair<int, int> period);
void reports_from_allparkspots(pair<int, int> period);
2019-07-07 18:15:51 +00:00
void current_status_parkspots(vector<Park_spot>& spots);
vector<Park_time> reports_from_customer(int cid, pair<int, int> period);
2019-07-20 23:32:47 +00:00
2019-07-07 18:15:51 +00:00
#endif // CUSTOMER_H