Changeset 18:96af91f8feed in rrlib_util


Ignore:
Timestamp:
07.02.2011 15:25:10 (9 years ago)
Author:
Tobias Föhst <foehst@…>
Branch:
default
Phase:
public
Convert:
svn:dcce5f72-5200-4218-9373-75d9081937af/trunk@25
Message:

Added comparison functions for tTime

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tTime.cpp

    r14 r18  
    3030  return str << "(" << time.TvSec() << ", " << time.TvUSec() << ")"; 
    3131} 
     32 
     33const bool rrlib::util::operator == (const tTime &a, const tTime &b) 
     34{ 
     35  return a.TvSec() == b.TvSec() && a.TvUSec() == b.TvUSec(); 
     36} 
     37 
     38const bool rrlib::util::operator != (const tTime &a, const tTime &b) 
     39{ 
     40  return !(a == b); 
     41} 
     42const bool rrlib::util::operator < (const tTime &a, const tTime &b) 
     43{ 
     44  return a.TvSec() == b.TvSec() ? a.TvUSec() < b.TvUSec() : a.TvSec() < b.TvSec(); 
     45} 
     46 
     47const bool rrlib::util::operator > (const tTime &a, const tTime &b) 
     48{ 
     49  return !(a == b || a < b); 
     50} 
  • tTime.h

    r14 r18  
    143143 
    144144std::ostream& operator<<(std::ostream& str, const tTime& time); 
     145 
     146const bool operator == (const tTime &a, const tTime &b); 
     147 
     148const bool operator != (const tTime &a, const tTime &b); 
     149 
     150const bool operator < (const tTime &a, const tTime &b); 
     151 
     152const bool operator > (const tTime &a, const tTime &b); 
     153 
    145154} 
    146155} 
Note: See TracChangeset for help on using the changeset viewer.