forked from ucsb-cs24-mirza-s21/lab01_data
-
Notifications
You must be signed in to change notification settings - Fork 0
/
perf.hpp
31 lines (25 loc) · 1.07 KB
/
perf.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef PERF_HPP
#define PERF_HPP
#include <cstdint>
#include <ostream>
struct PerformanceStats{
uint16_t horsepower; // Range: [0,65535]
uint32_t zeroToSixtyNs; // Range: (0,4294967296]
float headonDragCoeff; // Range: [0,1)
constexpr PerformanceStats(uint16_t hp,
uint32_t zeroToSixtyNanoseconds,
float headOnDragCoefficient):
horsepower(hp),
zeroToSixtyNs(zeroToSixtyNanoseconds),
headonDragCoeff(headOnDragCoefficient){}
// Not required to understand. Used for Gradescope tests ONLY.
bool operator==(PerformanceStats const& o) const;
bool operator!=(PerformanceStats const& o) const;
bool operator<(PerformanceStats const& o) const;
bool operator>(PerformanceStats const& o) const;
bool operator<=(PerformanceStats const& o) const;
bool operator>=(PerformanceStats const& o) const;
};
// Not required to understand. Used for Gradescope tests ONLY.
std::ostream& operator<<(std::ostream& o, PerformanceStats const& stats);
#endif //PERF_HPP