Parkmanne/headers/Park_time.h
2019-05-28 18:02:52 -03:00

40 lines
804 B
C++

#ifndef PARK_TIME_H
#define PARK_TIME_H
#pragma once
#include <chrono>
#include <iostream>
using namespace std::chrono;
/*
db repr of Park_time
int id (not null, auto increment)
int customer_id (not null) (many to one or something like that)
int spot_id (not null, many to one or something like that)
int duration
datetime start (not null)
datetime end
*/
class Park_time {
public:
int id;
int customer_id;
int spot_id;
int duration;
Park_time(int c_id, int s_id);
void clock_out(int c_id, int s_id);
friend std::ostream& operator<<(std::ostream& os, const Park_time & pt);
private:
high_resolution_clock::time_point start;
high_resolution_clock::time_point end;
//TODO: discuss pros cons of using chrono, ctime, or 3th party lib
};
#endif // Park_time