ratio.cc
Go to the documentation of this file.
/* ratio.cc
*/
#include "osl/stat/ratio.h"
#include <iostream>
osl::stat::Ratio::~Ratio()
{
if (name && ave.numElements()
&& (show_on_destructor
#ifdef SHOW_RATIO
|| 1
#endif
))
{
show();
}
}
void osl::stat::Ratio::show() const
{
std::cerr << name << " " << 100.0*ratio()
<< " " << static_cast<int>(ave.numElements() * ratio())
<< " / " << ave.numElements() << "\n";
}
/* ------------------------------------------------------------------------- */
// ;;; Local Variables:
// ;;; mode:c++
// ;;; c-basic-offset:2
// ;;; End:
osl::stat::Ratio::ave
Average ave
Definition ratio.h:14
osl::stat::Ratio::ratio
double ratio() const
Definition ratio.h:23
osl::stat::Ratio::show
void show() const
Definition ratio.cc:19
osl::stat::Ratio::name
const char * name
Definition ratio.h:15
osl::stat::Ratio::~Ratio
~Ratio()
Definition ratio.cc:6
osl::stat::Ratio::show_on_destructor
bool show_on_destructor
Definition ratio.h:16
ratio.h