#include "CTBcounter.hxx"
Public Methods | |
CTBcounter () | |
CTBcounter (const CTBcounter &rhs) | |
CTBcounter & | operator= (const CTBcounter &rhs) |
CTBcounter & | operator= (double d_count) |
CTBcounter & | operator= (int i_count) |
CTBcounter & | operator+= (double d_inc) |
CTBcounter & | operator+= (int i_inc) |
CTBcounter & | operator-= (double d_dec) |
CTBcounter & | operator-= (int i_dec) |
CTBcounter & | operator++ () |
CTBcounter | operator++ (int) |
CTBcounter & | operator-- () |
CTBcounter | operator-- (int) |
operator int () | |
operator double () | |
Private Attributes | |
double | md_count |
Friends | |
ostream & | operator<< (ostream &os, const CTBcounter &obj) |
istream & | operator>> (istream &is, CTBcounter &obj) |
CTBcounter
is not much more than a double
variable wrapped into a class. The key difference to a double
variable is that the counter is initialized with zero at construction time. This makes CTBcounter
especially useful in a context like:
CTBmap<CTBstring,CTBcounter> word_count; CTBstring word; ... word_count[word]++; ...
Definition at line 16 of file CTBcounter.hxx.
|
Default constructor.
Definition at line 17 of file CTBcounter.icc. |
|
Copy constructor.
Definition at line 24 of file CTBcounter.icc. |
|
Set counter to rhs.
Definition at line 31 of file CTBcounter.icc. |
|
Set counter to d_count.
Definition at line 40 of file CTBcounter.icc. |
|
Set counter to i_count.
Definition at line 49 of file CTBcounter.icc. |
|
Increment counter by d_cnt.
Definition at line 58 of file CTBcounter.icc. |
|
Increment counter by i_cnt.
Definition at line 67 of file CTBcounter.icc. |
|
Decrement counter by d_cnt.
Definition at line 76 of file CTBcounter.icc. |
|
Decrement counter by i_cnt.
Definition at line 85 of file CTBcounter.icc. |
|
Pre-increment counter by 1.
Definition at line 94 of file CTBcounter.icc. |
|
Post-increment by 1.
Definition at line 103 of file CTBcounter.icc. |
|
Pre-decrement counter by 1.
Definition at line 113 of file CTBcounter.icc. |
|
Post-decrement by 1.
Definition at line 122 of file CTBcounter.icc. |
|
Convert to int.
Definition at line 132 of file CTBcounter.icc. |
|
Convert to double.
Definition at line 140 of file CTBcounter.icc. |
|
ostream insertion operator.
Definition at line 45 of file CTBcounter.cxx. |
|
istream extraction operator.
Definition at line 151 of file CTBcounter.icc. |
|
the counter.
Definition at line 44 of file CTBcounter.hxx. |