forest-net
an overlay networks for large-scale virtual worlds
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
RateSpec.cpp
Go to the documentation of this file.
1 
9 #include "RateSpec.h"
10 
11 namespace forest {
12 
13 
19 bool RateSpec::read(istream& in) {
20  return Util::verify(in,'(') && Util::readNum(in,bitRateUp) &&
21  Util::verify(in,',') && Util::readNum(in,bitRateDown) &&
22  Util::verify(in,',') && Util::readNum(in,pktRateUp) &&
23  Util::verify(in,',') && Util::readNum(in,pktRateDown) &&
24  Util::verify(in,')');
25 }
26 
31 string RateSpec::toString() const {
32  stringstream ss;
33  ss << "(" << this->bitRateUp << "," << this->bitRateDown
34  << "," << this->pktRateUp << "," << this->pktRateDown << ")";
35  return ss.str();
36 }
37 
38 } // ends namespace
39