home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Ebooks / Thinking in C++ V2 / C18 / DataLogger.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-25  |  841 b   |  32 lines

  1. //: C18:DataLogger.h
  2. // From Thinking in C++, 2nd Edition
  3. // Available at http://www.BruceEckel.com
  4. // (c) Bruce Eckel 1999
  5. // Copyright notice in Copyright.txt
  6. // Datalogger record layout
  7. #ifndef DATALOG_H
  8. #define DATALOG_H
  9. #include <ctime>
  10. #include <iostream>
  11.  
  12. class DataPoint {
  13.   std::tm time; // Time & day
  14.   static const int bsz = 10;
  15.   // Ascii degrees (*) minutes (') seconds ("):
  16.   char latitude[bsz], longitude[bsz];
  17.   double depth, temperature;
  18. public:
  19.   std::tm getTime();
  20.   void setTime(std::tm t);
  21.   const char* getLatitude();
  22.   void setLatitude(const char* l);
  23.   const char* getLongitude();
  24.   void setLongitude(const char* l);
  25.   double getDepth();
  26.   void setDepth(double d);
  27.   double getTemperature();
  28.   void setTemperature(double t);
  29.   void print(std::ostream& os);
  30. };
  31. #endif // DATALOG_H ///:~
  32.