2 * This file Copyright (C) Mnemosyne LLC
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2
6 * as published by the Free Software Foundation.
8 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
10 * $Id: speed.h 11092 2010-08-01 20:36:13Z charles $
16 #include "formatter.h"
22 Speed( int Bps
): _Bps(Bps
) { }
26 int Bps( ) const { return _Bps
; }
27 bool isZero( ) const { return _Bps
== 0; }
28 static Speed
fromKBps( double KBps
);
29 static Speed
fromBps( int Bps
) { return Speed( Bps
); }
30 void setBps( int Bps
) { _Bps
= Bps
; }
31 Speed
& operator+=( const Speed
& that
) { _Bps
+= that
._Bps
; return *this; }
32 Speed
operator+( const Speed
& that
) const { return Speed( _Bps
+ that
._Bps
); }
33 bool operator<( const Speed
& that
) const { return _Bps
< that
._Bps
; }