Ignore:
Timestamp:
07/15/03 15:05:21 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Cosy/base
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Cosy/base/coord.h

    r1760 r2278  
    7474
    7575inline 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; }
     76inline ofstream& operator<<(ofstream &out, const XY &xy) { out << xy.X() << " " << xy.Y(); return out; }
    7777
    7878class AltAz : public XY
  • trunk/MagicSoft/Cosy/base/timer.cc

    r1959 r2278  
    6868}
    6969
    70 Timer::Timer(Timer &t)
     70Timer::Timer(const Timer &t)
    7171{
    7272    fMs   = t.fMs;
     
    124124}
    125125
    126 Timer::operator double() //[s]
     126Timer::operator double() const //[s]
    127127{
    128128    return fMs+fSecs;
     
    142142}
    143143
     144ostream &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_H
    2 #define TIMER_H
     1#ifndef COSY_Timer
     2#define COSY_Timer
    33
    44struct timeval;
    55
     6class ostream;
     7
    68class Timer
    79{
     10    friend ostream &operator<<(ostream &out, Timer &t);
    811private:
    912    double fMs;
     
    2831    Timer(double t);
    2932    Timer(struct timeval *tv);
    30     Timer(Timer &t);
     33    Timer(const Timer &t);
    3134
    3235    void SetTimer(int tv_sec, double tv_usec);
     
    5457    void Print();
    5558
    56     operator double(); //[s]
     59    operator double() const; //[s]
    5760};
    5861
     62ostream &operator<<(ostream &out, Timer &t);
     63
    5964#endif
Note: See TracChangeset for help on using the changeset viewer.