ACE  6.3.3
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ACE_Stats_Value Class Reference

Helper class for ACE_Stats. More...

#include <Stats.h>

Public Member Functions

 ACE_Stats_Value (const u_int precision)
 
u_int precision (void) const
 Accessor for precision. More...
 
void whole (const ACE_UINT32)
 Set the whole_ field. More...
 
ACE_UINT32 whole (void) const
 Accessor for the whole_ field. More...
 
void fractional (const ACE_UINT32)
 Set the fractional_ field. More...
 
ACE_UINT32 fractional (void) const
 Accessor for the fractional_ field. More...
 
ACE_UINT32 fractional_field (void) const
 
void scaled_value (ACE_UINT64 &) const
 
void dump (void) const
 Print to stdout. More...
 

Private Member Functions

 ACE_Stats_Value (void)
 

Private Attributes

ACE_UINT32 whole_
 The integer portion of the value. More...
 
ACE_UINT32 fractional_
 The fractional portion of the value. More...
 
u_int precision_
 

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.

Constructor & Destructor Documentation

ACE_Stats_Value::ACE_Stats_Value ( const u_int  precision)
inline

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.

ACE_Stats_Value::ACE_Stats_Value ( void  )
inlineprivate

Member Function Documentation

void ACE_Stats_Value::dump ( void  ) const
inline

Print to stdout.

void ACE_Stats_Value::fractional ( const ACE_UINT32  value)
inline

Set the fractional_ field.

ACE_UINT32 ACE_Stats_Value::fractional ( void  ) const
inline

Accessor for the fractional_ field.

ACE_UINT32 ACE_Stats_Value::fractional_field ( void  ) const

Calculates the maximum value of the fractional portion, given its precision.

u_int ACE_Stats_Value::precision ( void  ) const
inline

Accessor for precision.

void ACE_Stats_Value::scaled_value ( ACE_UINT64 sv) const
inline

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.

void ACE_Stats_Value::whole ( const ACE_UINT32  value)
inline

Set the whole_ field.

ACE_UINT32 ACE_Stats_Value::whole ( void  ) const
inline

Accessor for the whole_ field.

Member Data Documentation

ACE_UINT32 ACE_Stats_Value::fractional_
private

The fractional portion of the value.

u_int ACE_Stats_Value::precision_
private

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.

ACE_UINT32 ACE_Stats_Value::whole_
private

The integer portion of the value.


The documentation for this class was generated from the following files: