Zero  0.1.0
Public Member Functions | Protected Attributes | Friends | List of all members
w_stat_t Class Reference

A single statistic punning structure. More...

#include <w_stat.h>

Public Member Functions

 w_stat_t ()
 Initialize to zero. More...
 
 w_stat_t (int i)
 Initialize to integer i. More...
 
 operator int () const
 
 w_stat_t (w_base_t::base_float_t i)
 Initialize to floating point i. More...
 
 operator w_base_t::base_float_t () const
 Interpret as a floating point. More...
 

Protected Attributes

union {
   w_base_t::base_stat_t   i
 
   w_base_t::base_float_t   f
 
_u
 

Friends

class w_statistics_t
 
class w_stat_module_t
 
ostream & operator<< (ostream &out, const w_statistics_t &s)
 
bool operator== (const w_stat_t &, const w_stat_t &)
 
bool operator!= (const w_stat_t &, const w_stat_t &)
 

Detailed Description

A single statistic punning structure.

This structure holds a single generic statistic, be it an integer or a floating-point number. These are the statistics that are described in inputs to a Perl script, and whose handling-code is generated by that script. See Sets of Statistics.

This struct doesn't do much; it's a union of the two numeric types w_base_t::base_stat_t and w_base_t::base_float_t. With this class you output the contents to an output stream, and compare two stats (equal, not-equal).

Constructor & Destructor Documentation

§ w_stat_t() [1/3]

w_stat_t::w_stat_t ( )
inline

Initialize to zero.

§ w_stat_t() [2/3]

w_stat_t::w_stat_t ( int  i)
inline

Initialize to integer i.

§ w_stat_t() [3/3]

w_stat_t::w_stat_t ( w_base_t::base_float_t  i)
inline

Initialize to floating point i.

Member Function Documentation

§ operator int()

w_stat_t::operator int ( ) const
inline

§ operator w_base_t::base_float_t()

w_stat_t::operator w_base_t::base_float_t ( ) const
inline

Interpret as a floating point.

Friends And Related Function Documentation

§ operator!=

bool operator!= ( const w_stat_t ,
const w_stat_t  
)
friend

§ operator<<

ostream& operator<< ( ostream &  out,
const w_statistics_t s 
)
friend

§ operator==

bool operator== ( const w_stat_t ,
const w_stat_t  
)
friend

§ w_stat_module_t

friend class w_stat_module_t
friend

§ w_statistics_t

friend class w_statistics_t
friend

Member Data Documentation

§ _u

union { ... } w_stat_t::_u

§ f

§ i

w_base_t::base_stat_t w_stat_t::i

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