#include <Stats.h>
Public Member Functions | |
ACE_Stats_Value (const u_int precision) | |
u_int | precision (void) const |
Accessor for precision. | |
void | whole (const ACE_UINT32) |
Set the whole_ field. | |
ACE_UINT32 | whole (void) const |
Accessor for the whole_ field. | |
void | fractional (const ACE_UINT32) |
Set the fractional_ field. | |
ACE_UINT32 | fractional (void) const |
Accessor for the fractional_ field. | |
ACE_UINT32 | fractional_field (void) const |
void | scaled_value (ACE_UINT64 &) const |
void | dump (void) const |
Print to stdout. | |
Private Member Functions | |
ACE_Stats_Value (void) | |
Private Attributes | |
ACE_UINT32 | whole_ |
The integer portion of the value. | |
ACE_UINT32 | fractional_ |
The fractional portion of the value. | |
u_int | precision_ |
Container struct for 64-bit signed quantity and its precision. It would be nicer to use a fixed-point class, but this is sufficient. Users typically don't need to use this class directly; see ACE_Stats below.
Definition at line 41 of file Stats.h.
|
Constructor, which requires precision in terms of number of decimal digits. The more variation in the data, and the greater the data values, the smaller the precision must be to avoid overflow in the standard deviation calculation. 3 might be a good value, or maybe 4. 5 will probably be too large for non-trivial data sets. Definition at line 8 of file Stats.inl.
00009 : whole_ (0), 00010 fractional_ (0), 00011 precision_ (precision) 00012 { 00013 } |
|
Definition at line 85 of file Stats.h.
00085 {} |
|
Print to stdout.
Definition at line 59 of file Stats.inl. References ACE_DEBUG, ACE_LIB_TEXT, fractional_, LM_DEBUG, precision_, and whole_.
00060 { 00061 #if defined (ACE_HAS_DUMP) 00062 ACE_DEBUG ((LM_DEBUG, 00063 ACE_LIB_TEXT ("precision: %u digits; whole: %u, fractional: %u\n"), 00064 precision_, whole_, fractional_)); 00065 #endif /* ACE_HAS_DUMP */ 00066 } |
|
Accessor for the fractional_ field.
Definition at line 45 of file Stats.inl. References fractional_. Referenced by scaled_value().
00046 { 00047 return fractional_; 00048 } |
|
Set the fractional_ field.
Definition at line 38 of file Stats.inl. References fractional_. Referenced by ACE_Stats::mean(), ACE_Stats::print_summary(), ACE_Stats::quotient(), ACE_Stats::square_root(), and ACE_Stats::std_dev().
00039 { 00040 fractional_ = value; 00041 } |
|
Calculates the maximum value of the fractional portion, given its precision. Definition at line 18 of file Stats.cpp. References precision(). Referenced by ACE_Stats::quotient(), scaled_value(), ACE_Stats::square_root(), and ACE_Stats::std_dev().
|
|
Accessor for precision.
Definition at line 17 of file Stats.inl. References precision_. Referenced by fractional_field(), ACE_Stats::quotient(), ACE_Stats::square_root(), and ACE_Stats::std_dev().
00018 { 00019 return precision_; 00020 } |
|
Access the value as an _unsigned_ 64 bit quantity. It scales the value up by {precision} decimal digits, so that no precision will be lost. It assumes that {whole_} is >= 0. Definition at line 52 of file Stats.inl. References ACE_UINT64, fractional(), fractional_field(), and whole(). Referenced by ACE_Stats::std_dev().
00053 { 00054 sv = whole () * fractional_field () + fractional (); 00055 } |
|
Accessor for the whole_ field.
Definition at line 31 of file Stats.inl. References whole_. Referenced by scaled_value().
00032 { 00033 return whole_; 00034 } |
|
Set the whole_ field.
Definition at line 24 of file Stats.inl. References whole_. Referenced by ACE_High_Res_Timer::calibrate(), ACE_Stats::mean(), ACE_Stats::print_summary(), ACE_Stats::quotient(), ACE_Stats::square_root(), and ACE_Stats::std_dev().
00025 { 00026 whole_ = value; 00027 } |
|
The fractional portion of the value.
Definition at line 92 of file Stats.h. Referenced by dump(), and fractional(). |
|
The number of decimal digits of precision represented by {fractional_}. Not declared const, so the only way to change it is via the assignment operator. Definition at line 99 of file Stats.h. Referenced by dump(), and precision(). |
|
The integer portion of the value.
|