My Project
std
osl
stat
ratio.cc
Go to the documentation of this file.
1
/* ratio.cc
2
*/
3
#include "
osl/stat/ratio.h
"
4
#include <iostream>
5
6
osl::stat::Ratio::~Ratio
()
7
{
8
if
(
name
&&
ave
.numElements()
9
&& (
show_on_destructor
10
#ifdef SHOW_RATIO
11
|| 1
12
#endif
13
))
14
{
15
show
();
16
}
17
}
18
19
void
osl::stat::Ratio::show
()
const
20
{
21
std::cerr <<
name
<<
" "
<< 100.0*
ratio
()
22
<<
" "
<<
static_cast<
int
>
(
ave
.numElements() *
ratio
())
23
<<
" / "
<<
ave
.numElements() <<
"\n"
;
24
}
25
26
/* ------------------------------------------------------------------------- */
27
// ;;; Local Variables:
28
// ;;; mode:c++
29
// ;;; c-basic-offset:2
30
// ;;; 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
Generated by
1.15.0