2 * This file Copyright (C) 2009-2014 Mnemosyne LLC
4 * It may be used under the GNU GPL versions 2 or 3
5 * or any future license endorsed by Mnemosyne LLC.
7 * $Id: speed.h 14241 2014-01-21 03:10:30Z jordan $
13 #include "formatter.h"
19 Speed (int Bps
): _Bps (Bps
) {}
24 int Bps () const { return _Bps
; }
25 bool isZero () const { return _Bps
== 0; }
26 static Speed
fromKBps (double KBps
);
27 static Speed
fromBps (int Bps
) { return Speed (Bps
); }
28 void setBps (int Bps
) { _Bps
= Bps
; }
29 Speed
& operator+= (const Speed
& that
) { _Bps
+= that
._Bps
; return *this; }
30 Speed
operator+ (const Speed
& that
) const { return Speed (_Bps
+ that
._Bps
); }
31 bool operator< (const Speed
& that
) const { return _Bps
< that
._Bps
; }