#include <bin.h>
Inheritance diagram for Bin:
A Bin is implemented as a SparseTreeNode with two data members: a size and a count.
Public Member Functions | |
Bin () | |
Bin (const LargeIndex &index) | |
virtual | ~Bin () |
void | set_size (double size) |
Sets the size of the bin. | |
double | size () const |
Get the size of the bin. | |
void | set_count (double count) |
Set the count. | |
double | count () 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 SparseTreeNode &other) |
Combine data from two Bins. | |
const LargeIndex & | index () const |
SparseTreeNode * | parent () |
SparseTreeNode * | prev_sibling () |
SparseTreeNode * | next_sibling () |
SparseTreeNode * | first_child () |
SparseTreeNode * | last_child () |
void | set_parent (SparseTreeNode *parent) |
void | set_prev_sibling (SparseTreeNode *sibling) |
void | set_next_sibling (SparseTreeNode *sibling) |
void | set_first_child (SparseTreeNode *child) |
void | set_last_child (SparseTreeNode *child) |
void | set_index (const LargeIndex &index) |
bool | has_parent () const |
bool | has_prev_sibling () const |
bool | has_next_sibling () const |
bool | has_child () 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 SparseTreeNode &other) const |
Returns true if this node's index is smaller than that of <other>. | |
Static Public Member Functions | |
static bool | CompareNodes (const SparseTreeNode *one, const SparseTreeNode *two) |
Returns true if <one>'s index is smaller than that of <two>. |
Bin | ( | ) |
Bin | ( | const LargeIndex & | index | ) |
virtual ~Bin | ( | ) | [inline, virtual] |
void set_size | ( | double | size | ) | [inline] |
Sets the size of the bin.
double size | ( | ) | const [inline] |
Get the size of the bin.
void set_count | ( | double | count | ) | [inline] |
Set the count.
double count | ( | ) | const [inline] |
Get the current count.
void ReadData | ( | istream & | input_stream | ) | [virtual] |
void WriteData | ( | ostream & | output_stream | ) | const [virtual] |
void Combine | ( | const SparseTreeNode & | other | ) | [virtual] |
Combine data from two Bins.
To combine bins, we take the max of the sizes, and add the counts.
Implements SparseTreeNode.
const LargeIndex& index | ( | ) | const [inline, inherited] |
SparseTreeNode* parent | ( | ) | [inline, inherited] |
SparseTreeNode* prev_sibling | ( | ) | [inline, inherited] |
SparseTreeNode* next_sibling | ( | ) | [inline, inherited] |
SparseTreeNode* first_child | ( | ) | [inline, inherited] |
SparseTreeNode* last_child | ( | ) | [inline, inherited] |
void set_parent | ( | SparseTreeNode * | parent | ) | [inline, inherited] |
void set_prev_sibling | ( | SparseTreeNode * | sibling | ) | [inline, inherited] |
void set_next_sibling | ( | SparseTreeNode * | sibling | ) | [inline, inherited] |
void set_first_child | ( | SparseTreeNode * | child | ) | [inline, inherited] |
void set_last_child | ( | SparseTreeNode * | child | ) | [inline, inherited] |
void set_index | ( | const LargeIndex & | index | ) | [inline, inherited] |
bool has_parent | ( | ) | const [inline, inherited] |
bool has_prev_sibling | ( | ) | const [inline, inherited] |
bool has_next_sibling | ( | ) | const [inline, inherited] |
bool has_child | ( | ) | const [inline, 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:
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().
bool operator< | ( | const SparseTreeNode & | other | ) | const [inherited] |
Returns true if this node's index is smaller than that of <other>.
bool CompareNodes | ( | const SparseTreeNode * | one, | |
const SparseTreeNode * | two | |||
) | [static, inherited] |
Returns true if <one>'s index is smaller than that of <two>.