NCBI C++ ToolKit
Public Member Functions | Private Attributes | List of all members
CSrvStatTerm< T > Class Template Reference

Search Toolkit Book for CSrvStatTerm

Class representing one statistical value. More...

#include "srv_stat.hpp"
(Private to src/app/netcache.)

+ Inheritance diagram for CSrvStatTerm< T >:
+ Collaboration diagram for CSrvStatTerm< T >:

Public Member Functions

 CSrvStatTerm (void)
 Empty constructor, all initialization should be made in Initialize() because in memory manager static objects are used before constructors are called. More...
 
void Initialize (void)
 Initialize all data members. More...
 
void AddValue (T value)
 Add next value into the set. More...
 
Uint8 GetCount (void) const
 Get number of values in the set. More...
 
Uint8 GetSum (void) const
 Get sum of all values in the set. More...
 
T GetMaximum (void) const
 Get maximum value in the set. More...
 
T GetAverage (void) const
 Get average of all values in the set. More...
 
double GetDoubleAvg (void) const
 
void AddValues (const CSrvStatTerm< T > &other)
 Add all values from another set. More...
 

Private Attributes

Uint8 m_ValuesSum
 Sum of all values collected. More...
 
Uint8 m_ValuesCount
 Number of all values collected. More...
 
T m_ValuesMax
 Maximum value among collected. More...
 

Detailed Description

template<class T>
class CSrvStatTerm< T >

Class representing one statistical value.

Object collects set of values and can return number of values in set, sum of all values, maximum value and average of all values.

Definition at line 128 of file srv_stat.hpp.

Constructor & Destructor Documentation

◆ CSrvStatTerm()

template<class T >
CSrvStatTerm< T >::CSrvStatTerm ( void  )
inline

Empty constructor, all initialization should be made in Initialize() because in memory manager static objects are used before constructors are called.

Definition at line 525 of file srv_stat.hpp.

Member Function Documentation

◆ AddValue()

template<class T >
void CSrvStatTerm< T >::AddValue ( T  value)
inline

◆ AddValues()

template<class T >
void CSrvStatTerm< T >::AddValues ( const CSrvStatTerm< T > &  other)
inline

◆ GetAverage()

template<class T >
T CSrvStatTerm< T >::GetAverage ( void  ) const
inline

◆ GetCount()

template<class T >
Uint8 CSrvStatTerm< T >::GetCount ( void  ) const
inline

◆ GetDoubleAvg()

template<class T >
double CSrvStatTerm< T >::GetDoubleAvg ( void  ) const
inline

Definition at line 585 of file srv_stat.hpp.

Referenced by CSrvStat::PrintToLogs(), and CSrvStat::PrintToSocket().

◆ GetMaximum()

template<class T >
T CSrvStatTerm< T >::GetMaximum ( void  ) const
inline

◆ GetSum()

template<class T >
Uint8 CSrvStatTerm< T >::GetSum ( void  ) const
inline

Get sum of all values in the set.

The return type is Uint8 because the class is not used with doubles. If it ever will collect doubles the return type should be adjusted smartly (to be double for T==double and Uint8 for all unsigned integers).

Definition at line 564 of file srv_stat.hpp.

Referenced by CSrvStat::PrintToLogs(), CNCStat::PrintToLogs(), CSrvStat::PrintToSocket(), and CNCStat::PrintToSocket().

◆ Initialize()

template<class T >
void CSrvStatTerm< T >::Initialize ( void  )
inline

Initialize all data members.

Definition at line 530 of file srv_stat.hpp.

Referenced by SMMStat::ClearStats(), CNCStat::x_ClearStats(), and CSrvStat::x_ClearStats().

Member Data Documentation

◆ m_ValuesCount

template<class T >
Uint8 CSrvStatTerm< T >::m_ValuesCount
private

Number of all values collected.

Definition at line 164 of file srv_stat.hpp.

Referenced by CSrvStatTerm< T >::AddValues().

◆ m_ValuesMax

template<class T >
T CSrvStatTerm< T >::m_ValuesMax
private

Maximum value among collected.

Definition at line 166 of file srv_stat.hpp.

Referenced by CSrvStatTerm< T >::AddValues().

◆ m_ValuesSum

template<class T >
Uint8 CSrvStatTerm< T >::m_ValuesSum
private

Sum of all values collected.

The type is Uint8 because the class is not used with doubles. If it ever will collect doubles the type of m_ValueSum should be adjusted smartly (to be double for T==double and Uint8 for all unsigned integers).

Definition at line 162 of file srv_stat.hpp.

Referenced by CSrvStatTerm< T >::AddValues().


The documentation for this class was generated from the following file:
Modified on Tue May 21 10:55:26 2024 by modify_doxy.py rev. 669887