Helper class for ACE_Stats.
More...
#include <Stats.h>
List of all members.
Detailed Description
Helper class for ACE_Stats.
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 & Destructor Documentation
ACE_Stats_Value::ACE_Stats_Value |
( |
const u_int |
precision |
) |
|
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.
ACE_Stats_Value::ACE_Stats_Value |
( |
void |
|
) |
[inline, private] |
Member Function Documentation
void ACE_Stats_Value::dump |
( |
void |
|
) |
const |
Print to stdout.
Definition at line 59 of file Stats.inl.
void ACE_Stats_Value::fractional |
( |
const ACE_UINT32 |
value |
) |
|
Set the fractional_ field.
Definition at line 38 of file Stats.inl.
ACE_UINT32 ACE_Stats_Value::fractional |
( |
void |
|
) |
const |
Accessor for the fractional_ field.
Definition at line 45 of file Stats.inl.
ACE_UINT32 ACE_Stats_Value::fractional_field |
( |
void |
|
) |
const |
Calculates the maximum value of the fractional portion, given its precision.
Definition at line 17 of file Stats.cpp.
{
if (precision () == 0)
{
return 1;
}
else
{
ACE_UINT32 field = 10;
for (u_int i = 0; i < precision () - 1; ++i)
{
field *= 10;
}
return field;
}
}
u_int ACE_Stats_Value::precision |
( |
void |
|
) |
const |
Accessor for precision.
Definition at line 17 of file Stats.inl.
void ACE_Stats_Value::scaled_value |
( |
ACE_UINT64 & |
sv |
) |
const |
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.
ACE_UINT32 ACE_Stats_Value::whole |
( |
void |
|
) |
const |
Accessor for the whole_ field.
Definition at line 31 of file Stats.inl.
void ACE_Stats_Value::whole |
( |
const ACE_UINT32 |
value |
) |
|
Set the whole_ field.
Definition at line 24 of file Stats.inl.
Member Data Documentation
The fractional portion of the value.
Definition at line 92 of file Stats.h.
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.
The integer portion of the value.
Definition at line 89 of file Stats.h.
The documentation for this class was generated from the following files: