forest-net
an overlay networks for large-scale virtual worlds
|
This class stores bit rates and packet rates for links in both directions. More...
#include <RateSpec.h>
Public Member Functions | |
RateSpec () | |
Default constructor. More... | |
RateSpec (int r) | |
Constructor that sets all rate fields to a common value. More... | |
RateSpec (int bru, int brd, int pru, int prd) | |
Constructor that sets all rate fields to specified values. More... | |
RateSpec (RateSpec &rs) | |
Constructor that sets all rate fields to specified values. More... | |
void | reset () |
bool | isSet () |
void | set (int r) |
Set all rate fields to a single value. More... | |
void | set (int bru, int brd, int pru, int prd) |
Set all rate fields to specified values. More... | |
bool | isZero () |
Determine if all fields are zero. More... | |
void | flip () |
Reverse the up/down direction of the fields. | |
void | add (const RateSpec &rs) |
Add the fields in another RateSpec to this one. More... | |
void | subtract (const RateSpec &rs) |
Subtract the fields in another RateSpec from this one. More... | |
void | negate () |
Negate all rates. More... | |
void | scale (double f) |
Scale the fields in this RateSpec by a constant. More... | |
bool | equals (const RateSpec &rs) |
Compare another RateSpec to this for equality. More... | |
bool | leq (const RateSpec &rs) |
Compare another RateSpec to this one. More... | |
bool | read (istream &) |
Read up to first occurrence of a given character. More... | |
string | toString () const |
Create a string representation of the rate spec. More... | |
Public Attributes | |
int | bitRateUp |
upstream bit rate on comtree link | |
int | bitRateDown |
downstream bit rate on comtree link | |
int | pktRateUp |
upstream packet rate on comtree link | |
int | pktRateDown |
downstream packet rate on comtree link | |
This class stores bit rates and packet rates for links in both directions.
Directions are referred to as "up" and "down" to relate easily to usage in comtrees.
Definition at line 21 of file RateSpec.h.
|
inline |
Default constructor.
Definition at line 29 of file RateSpec.h.
|
inline |
Constructor that sets all rate fields to a common value.
Definition at line 32 of file RateSpec.h.
|
inline |
Constructor that sets all rate fields to specified values.
Definition at line 35 of file RateSpec.h.
|
inline |
Constructor that sets all rate fields to specified values.
Definition at line 40 of file RateSpec.h.
|
inline |
Add the fields in another RateSpec to this one.
Definition at line 75 of file RateSpec.h.
|
inline |
Compare another RateSpec to this for equality.
Definition at line 101 of file RateSpec.h.
|
inline |
Determine if all fields are zero.
Definition at line 62 of file RateSpec.h.
|
inline |
Compare another RateSpec to this one.
Definition at line 109 of file RateSpec.h.
|
inline |
Negate all rates.
Definition at line 87 of file RateSpec.h.
bool forest::RateSpec::read | ( | istream & | in) |
Read up to first occurrence of a given character.
in | is the input stream to read from |
c | is character to look for |
Definition at line 19 of file RateSpec.cpp.
|
inline |
Scale the fields in this RateSpec by a constant.
Definition at line 93 of file RateSpec.h.
|
inline |
Set all rate fields to a single value.
Definition at line 51 of file RateSpec.h.
|
inline |
Set all rate fields to specified values.
Definition at line 56 of file RateSpec.h.
|
inline |
Subtract the fields in another RateSpec from this one.
Definition at line 81 of file RateSpec.h.
string forest::RateSpec::toString | ( | ) | const |
Create a string representation of the rate spec.
s | is a reference to a string in which result is returned |
return | a reference to s |
Definition at line 31 of file RateSpec.cpp.