//: C04:DataLogger.h // From "Thinking in C++, Volume 2", by Bruce Eckel & Chuck Allison. // (c) 1995-2004 MindView, Inc. All Rights Reserved. // See source code use permissions stated in the file 'License.txt', // distributed with the code package available at www.MindView.net. // Datalogger record layout. #ifndef DATALOG_H #define DATALOG_H #include #include #include using std::ostream; struct Coord { int deg, min, sec; Coord(int d = 0, int m = 0, int s = 0) : deg(d), min(m), sec(s) {} std::string toString() const; }; ostream& operator<<(ostream&, const Coord&); class DataPoint { std::time_t timestamp; // Time & day Coord latitude, longitude; double depth, temperature; public: DataPoint(std::time_t ts, const Coord& lat, const Coord& lon, double dep, double temp) : timestamp(ts), latitude(lat), longitude(lon), depth(dep), temperature(temp) {} DataPoint() : timestamp(0), depth(0), temperature(0) {} friend ostream& operator<<(ostream&, const DataPoint&); }; #endif // DATALOG_H ///:~