Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Timer_Wheel_T.cpp File Reference

#include "ace/Timer_Wheel_T.h"
#include "ace/Log_Msg.h"

Include dependency graph for Timer_Wheel_T.cpp:

Include dependency graph

Go to the source code of this file.

Functions

const char * get_rcsid_ace_Timer_Wheel_T (const char *)
int power2bits (int n, int min_bits, int max_bits)

Variables

const char * rcsid_ace_Timer_Wheel_T = get_rcsid_ace_Timer_Wheel_T ( rcsid_ace_Timer_Wheel_T )


Function Documentation

const char* get_rcsid_ace_Timer_Wheel_T const char *    [inline, static]
 

Definition at line 13 of file Timer_Wheel_T.cpp.

00013 : Timer_Wheel_T.cpp,v 1.1.1.4 2003/02/21 18:36:32 chad Exp $")

int power2bits int    n,
int    min_bits,
int    max_bits
[static]
 

Definition at line 94 of file Timer_Wheel_T.cpp.

Referenced by ACE_Timer_Wheel_T::open_i.

00094                                                     {
00095     int max = (1 << max_bits) - 1;
00096     if (n > max) {
00097       return max_bits;
00098     }
00099     // count the bits in n.
00100     int i = 0;
00101     int tmp = n;
00102     do {
00103       tmp >>= 1;
00104       ++i;
00105     } while (tmp != 0);
00106 
00107     if (i <= min_bits) {
00108       return min_bits;
00109     }
00110     // Which is nearest?
00111     int a = (1 << i) - n;
00112     int b = (1 << (i - 1)) - n;
00113     if (b < 0)
00114       b = -b;
00115     if (b < a)
00116       return i - 1;
00117     return i;
00118   }


Variable Documentation

const char* rcsid_ace_Timer_Wheel_T = get_rcsid_ace_Timer_Wheel_T ( rcsid_ace_Timer_Wheel_T ) [static]
 

Definition at line 13 of file Timer_Wheel_T.cpp.


Generated on Mon Jun 16 12:38:06 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002