Polaris: Average Class Reference

Average Class Reference

Simple class for keeping track of the average of a stream of numbers. More...

#include <Average.h>

List of all members.

Public Member Functions

 Average ()
 Average (const Average &)
 ~Average ()
void add (int value)
void print (ostream &) const

Friends

ostream & operator<< (ostream &o, const Average &avg)


Detailed Description

Simple class for keeping track of the average of a stream of numbers.

Polaris Base

See also:
Average.h

Average.h

Average.cc

Overview

The Average class keeps track of the average of a stream of numbers by keeping track of how many times it was called and the overall sum of the numbers.

Definition at line 28 of file Average.h.


Constructor & Destructor Documentation

Average::Average  ) 
 

Definition at line 11 of file Average.cc.

References register_instance().

Average::Average const Average  ) 
 

Average::~Average  ) 
 

Definition at line 22 of file Average.cc.

References unregister_instance().


Member Function Documentation

void Average::add int  value  ) 
 

Definition at line 29 of file Average.cc.

void Average::print ostream &   )  const
 

Definition at line 37 of file Average.cc.


Friends And Related Function Documentation

ostream& operator<< ostream &  o,
const Average avg
[friend]
 

Definition at line 41 of file Average.cc.


The documentation for this class was generated from the following files:
 © 1995-2005 University of Illinois, Urbana-Champaign. All rights reserved.  Fri Mar 25 23:06:58 2005