Index: trunk/MagicSoft/Mars/mbase/BaseLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/BaseLinkDef.h	(revision 2612)
+++ trunk/MagicSoft/Mars/mbase/BaseLinkDef.h	(revision 2617)
@@ -50,4 +50,5 @@
 
 #pragma link C++ class MTime+;
+#pragma link C++ function operator<<(ostream&, const MTime&);
 
 #pragma link C++ class MArgs+;
Index: trunk/MagicSoft/Mars/mbase/MTime.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTime.h	(revision 2612)
+++ trunk/MagicSoft/Mars/mbase/MTime.h	(revision 2617)
@@ -22,28 +22,21 @@
 class MTime : public MParContainer
 {
-    friend bool operator==(MTime &t1, MTime &t2);
-    friend bool operator!=(MTime &t1, MTime &t2);
-    friend bool operator< (MTime &t1, MTime &t2);
-    friend bool operator> (MTime &t1, MTime &t2);
-    //friend bool operator<=(MTime &t1, MTime &t2);
-    //friend bool operator>=(MTime &t1, MTime &t2);
-
 private:
     static const UInt_t kHour; // [ms] one hour
     static const UInt_t kDay;  // [ms] one day
 
-     UInt_t fMjd;     // [d]  Day in the century        (Day of sun rise)
-     TTime  fTime;    // [ms] Time of Day               (-11h<=x<13h)
-     UInt_t fNanoSec; // [ns] NanoSec part of TimeOfDay (<1000000)
+    UInt_t fMjd;     // [d]  Day in the century        (Day of sun rise)
+    TTime  fTime;    // [ms] Time of Day               (-11h<=x<13h)
+    UInt_t fNanoSec; // [ns] NanoSec part of TimeOfDay (<1000000)
 
-     ULong_t GetTime24() const
-     {
-         return (Long_t)fTime<0 ? (Long_t)fTime+kDay : (ULong_t)fTime;
-     }
-     void Init(const char *name, const char *title)
-     {
+    ULong_t GetTime24() const
+    {
+        return (Long_t)fTime<0 ? (Long_t)fTime+kDay : (ULong_t)fTime;
+    }
+    void Init(const char *name, const char *title)
+    {
         fName  = name  ? name  : "MTime";
         fTitle = title ? title : "Generalized time stamp";
-     }
+    }
 
 public:
@@ -111,50 +104,54 @@
     }
 
+    bool operator<(const MTime &t) const
+    {
+        if (fMjd<t.fMjd)
+            return true;
+        if (fMjd==t.fMjd && fTime<t.fTime)
+            return true;
+        if (fMjd==t.fMjd && fTime==t.fTime && fNanoSec<t.fNanoSec)
+            return true;
+        return false;
+    }
+    bool operator>(const MTime &t) const
+    {
+        if (fMjd>t.fMjd)
+            return true;
+        if (fMjd==t.fMjd && fTime>t.fTime)
+            return true;
+        if (fMjd==t.fMjd && fTime==t.fTime && fNanoSec>t.fNanoSec)
+            return true;
+        return false;
+    }
+
+    bool operator<=(const MTime &t) const
+    {
+        return !operator>(t);
+    }
+
+    bool operator>=(const MTime &t) const
+    {
+        return !operator<(t);
+    }
+
+    bool operator==(const MTime &t) const
+    {
+        return fNanoSec==t.fNanoSec && fTime==t.fTime && fMjd==t.fMjd;
+    }
+
+    bool operator!=(const MTime &t) const
+    {
+        return fNanoSec!=t.fNanoSec || fTime!=t.fTime || fMjd!=t.fMjd;
+    }
+
+    bool operator!() const
+    {
+        return fNanoSec==0 && (ULong_t)fTime==0 && fMjd==0;
+    }
+
     ClassDef(MTime, 3)	//A generalized MARS time stamp
 };
 
-inline bool operator<(MTime &t1, MTime &t2)
-{
-    if (t1.fMjd<t2.fMjd)
-        return true;
-    if (t1.fMjd==t2.fMjd && t1.fTime<t2.fTime)
-        return true;
-    if (t1.fMjd==t2.fMjd && t1.fTime==t2.fTime && t1.fNanoSec<t2.fNanoSec)
-        return true;
-    return false;
-}
-
-inline bool operator>(MTime &t1, MTime &t2)
-{
-    if (t1.fMjd>t2.fMjd)
-        return true;
-    if (t1.fMjd==t2.fMjd && t1.fTime>t2.fTime)
-        return true;
-    if (t1.fMjd==t2.fMjd && t1.fTime==t2.fTime && t1.fNanoSec>t2.fNanoSec)
-        return true;
-    return false;
-}
-
-inline bool operator<=(MTime &t1, MTime &t2)
-{
-    return !(t1>t2);
-}
-
-inline bool operator>=(MTime &t1, MTime &t2)
-{
-    return !(t1<t2);
-}
-
-inline bool operator==(MTime &t1, MTime &t2)
-{
-    return t1.fNanoSec==t2.fNanoSec && t1.fTime==t2.fTime && t1.fMjd==t2.fMjd;
-}
-
-inline bool operator!=(MTime &t1, MTime &t2)
-{
-    return t1.fNanoSec!=t2.fNanoSec || t1.fTime!=t2.fTime || t1.fMjd!=t2.fMjd;
-}
-
-inline ostream &operator<<(ostream &out, MTime &t)
+inline ostream &operator<<(ostream &out, const MTime &t)
 {
     out << t.GetString();
