Changeset 2278 for trunk/MagicSoft/Cosy/base
- Timestamp:
- 07/15/03 15:05:21 (21 years ago)
- Location:
- trunk/MagicSoft/Cosy/base
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/base/coord.h
r1760 r2278 74 74 75 75 inline ifstream& operator>>(ifstream &in, XY &xy) { in >> xy.fX; in >> xy.fY; return in; } 76 inline ofstream& operator<<(ofstream &out, XY &xy) { out << xy.fX << " " << xy.fY; return out; }76 inline ofstream& operator<<(ofstream &out, const XY &xy) { out << xy.X() << " " << xy.Y(); return out; } 77 77 78 78 class AltAz : public XY -
trunk/MagicSoft/Cosy/base/timer.cc
r1959 r2278 68 68 } 69 69 70 Timer::Timer( Timer &t)70 Timer::Timer(const Timer &t) 71 71 { 72 72 fMs = t.fMs; … … 124 124 } 125 125 126 Timer::operator double() //[s]126 Timer::operator double() const //[s] 127 127 { 128 128 return fMs+fSecs; … … 142 142 } 143 143 144 ostream &operator<<(ostream &out, Timer &t) 145 { 146 char text[256]; 147 148 sprintf(text, "%d/%02d/%02d %d:%02d:%02d.%01li", 149 t.fYea, t.fMon, t.fDay, t.fHor, t.fMin, t.fSec, (long)(10.0*t.fMs)); 150 151 out << text; 152 return out; 153 } -
trunk/MagicSoft/Cosy/base/timer.h
r1810 r2278 1 #ifndef TIMER_H2 #define TIMER_H1 #ifndef COSY_Timer 2 #define COSY_Timer 3 3 4 4 struct timeval; 5 5 6 class ostream; 7 6 8 class Timer 7 9 { 10 friend ostream &operator<<(ostream &out, Timer &t); 8 11 private: 9 12 double fMs; … … 28 31 Timer(double t); 29 32 Timer(struct timeval *tv); 30 Timer( Timer &t);33 Timer(const Timer &t); 31 34 32 35 void SetTimer(int tv_sec, double tv_usec); … … 54 57 void Print(); 55 58 56 operator double() ; //[s]59 operator double() const; //[s] 57 60 }; 58 61 62 ostream &operator<<(ostream &out, Timer &t); 63 59 64 #endif
Note:
See TracChangeset
for help on using the changeset viewer.