forest-net
an overlay networks for large-scale virtual worlds
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
forest::RateSpec Class Reference

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
 

Detailed Description

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.

Constructor & Destructor Documentation

forest::RateSpec::RateSpec ( )
inline

Default constructor.

Definition at line 29 of file RateSpec.h.

forest::RateSpec::RateSpec ( int  r)
inline

Constructor that sets all rate fields to a common value.

Definition at line 32 of file RateSpec.h.

Here is the call graph for this function:

forest::RateSpec::RateSpec ( int  bru,
int  brd,
int  pru,
int  prd 
)
inline

Constructor that sets all rate fields to specified values.

Definition at line 35 of file RateSpec.h.

Here is the call graph for this function:

forest::RateSpec::RateSpec ( RateSpec rs)
inline

Constructor that sets all rate fields to specified values.

Definition at line 40 of file RateSpec.h.

Member Function Documentation

void forest::RateSpec::add ( const RateSpec rs)
inline

Add the fields in another RateSpec to this one.

Definition at line 75 of file RateSpec.h.

Here is the caller graph for this function:

bool forest::RateSpec::equals ( const RateSpec rs)
inline

Compare another RateSpec to this for equality.

Definition at line 101 of file RateSpec.h.

Here is the caller graph for this function:

bool forest::RateSpec::isZero ( )
inline

Determine if all fields are zero.

Definition at line 62 of file RateSpec.h.

Here is the caller graph for this function:

bool forest::RateSpec::leq ( const RateSpec rs)
inline

Compare another RateSpec to this one.

Definition at line 109 of file RateSpec.h.

Here is the caller graph for this function:

void forest::RateSpec::negate ( )
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.

Parameters
inis the input stream to read from
cis character to look for
Returns
c or 0, on end-of-file

Definition at line 19 of file RateSpec.cpp.

Here is the caller graph for this function:

void forest::RateSpec::scale ( double  f)
inline

Scale the fields in this RateSpec by a constant.

Definition at line 93 of file RateSpec.h.

Here is the caller graph for this function:

void forest::RateSpec::set ( int  r)
inline

Set all rate fields to a single value.

Definition at line 51 of file RateSpec.h.

Here is the caller graph for this function:

void forest::RateSpec::set ( int  bru,
int  brd,
int  pru,
int  prd 
)
inline

Set all rate fields to specified values.

Definition at line 56 of file RateSpec.h.

void forest::RateSpec::subtract ( const RateSpec rs)
inline

Subtract the fields in another RateSpec from this one.

Definition at line 81 of file RateSpec.h.

Here is the caller graph for this function:

string forest::RateSpec::toString ( ) const

Create a string representation of the rate spec.

Parameters
sis a reference to a string in which result is returned
returna reference to s

Definition at line 31 of file RateSpec.cpp.

Here is the caller graph for this function:


The documentation for this class was generated from the following files: