Bin Class Reference

#include <bin.h>

Inheritance diagram for Bin:

TreeNode List of all members.

Detailed Description

Encapsulates a histogram bin.

A Bin is implemented as a TreeNode with two data members: a size and a count.


Public Member Functions

 Bin ()
 Bin (const LargeIndex &index)
virtual ~Bin ()
double SetSize (double size)
 Sets the size of the bin; returns the old size.
double GetSize () const
 Get the size of the bin.
double IncrementCount ()
 Increase the count by 1. Returns the final count.
double DecrementCount ()
 Decrease the count by 1. Returns the final count.
double SetCount (double count)
 Set the count. Returns the new count.
double GetCount () const
 Get the current count.
virtual void ReadData (istream &input_stream)
 Read the data, excluding the index, from a stream.
virtual void WriteData (ostream &output_stream) const
 Write the data, excluding the index, to a stream.
virtual void Combine (const TreeNode &other)
 Combine data from two Bins.
const LargeIndexGetIndex () const
TreeNodeGetParent ()
TreeNodeGetPreviousSibling ()
TreeNodeGetNextSibling ()
TreeNodeGetFirstChild ()
TreeNodeGetLastChild ()
void SetParent (TreeNode *parent)
void SetPreviousSibling (TreeNode *sibling)
void SetNextSibling (TreeNode *sibling)
void SetFirstChild (TreeNode *child)
void SetLastChild (TreeNode *child)
void SetIndex (const LargeIndex &index)
bool HasParent () const
bool HasPreviousSibling () const
bool HasNextSibling () const
bool HasChild () const
void ReadFromStream (istream &input_stream)
 Read the data, including the index, from a stream.
void WriteToStream (ostream &output_stream) const
 Write the data, including the index, to a stream.
bool operator< (const TreeNode &other) const
 Returns true if this node's index is smaller than that of <other>.

Static Public Member Functions

static bool CompareNodes (const TreeNode *one, const TreeNode *two)
 Returns true if <one>'s index is smaller than that of <two>.


Constructor & Destructor Documentation

Bin (  ) 

Bin ( const LargeIndex index  ) 

virtual ~Bin (  )  [inline, virtual]


Member Function Documentation

double SetSize ( double  size  ) 

Sets the size of the bin; returns the old size.

double GetSize (  )  const

Get the size of the bin.

double IncrementCount (  ) 

Increase the count by 1. Returns the final count.

double DecrementCount (  ) 

Decrease the count by 1. Returns the final count.

double SetCount ( double  count  ) 

Set the count. Returns the new count.

double GetCount (  )  const

Get the current count.

void ReadData ( istream &  input_stream  )  [virtual]

Read the data, excluding the index, from a stream.

Implements TreeNode.

void WriteData ( ostream &  output_stream  )  const [virtual]

Write the data, excluding the index, to a stream.

Implements TreeNode.

void Combine ( const TreeNode other  )  [virtual]

Combine data from two Bins.

To combine bins, we take the max of the sizes, and add the counts.

Implements TreeNode.

const LargeIndex & GetIndex (  )  const [inherited]

TreeNode * GetParent (  )  [inherited]

TreeNode * GetPreviousSibling (  )  [inherited]

TreeNode * GetNextSibling (  )  [inherited]

TreeNode * GetFirstChild (  )  [inherited]

TreeNode * GetLastChild (  )  [inherited]

void SetParent ( TreeNode parent  )  [inherited]

void SetPreviousSibling ( TreeNode sibling  )  [inherited]

void SetNextSibling ( TreeNode sibling  )  [inherited]

void SetFirstChild ( TreeNode child  )  [inherited]

void SetLastChild ( TreeNode child  )  [inherited]

void SetIndex ( const LargeIndex index  )  [inherited]

bool HasParent (  )  const [inherited]

bool HasPreviousSibling (  )  const [inherited]

bool HasNextSibling (  )  const [inherited]

bool HasChild (  )  const [inherited]

void ReadFromStream ( istream &  input_stream  )  [inherited]

Read the data, including the index, from a stream.

Calling this will override the node's current index. The format is:

It will then call ReadData().
See also:
ReadData()

void WriteToStream ( ostream &  output_stream  )  const [inherited]

Write the data, including the index, to a stream.

This will simply write the index to the stream, followed by WriteData().

See also:
WriteData().

bool operator< ( const TreeNode other  )  const [inherited]

Returns true if this node's index is smaller than that of <other>.

bool CompareNodes ( const TreeNode one,
const TreeNode two 
) [static, inherited]

Returns true if <one>'s index is smaller than that of <two>.


The documentation for this class was generated from the following files:
Generated on Wed May 2 11:17:13 2007 for libpmk by  doxygen 1.5.1