Scheduler
countingWheel.cpp
Go to the documentation of this file.
1 
10 #include "countingWheel.h"
11 
12 
13 using namespace Utils;
14 
15 
16 CountingWheel::CountingWheel(unsigned int b) : base(b)
17 {
18 }
19 
21 {
22  value = 0;
23 }
24 
26 {
27  if (base == 0)
28  return true;
29  value++;
30  if (value == base)
31  {
32  value = 0;
33  return true;
34  }
35  return false;
36 }
37 
39 {
40  return value;
41 }
42 
43 
44 
45 unsigned int CountingWheel::getBase()
46 {
47  return base;
48 }
CountingWheel(unsigned int base)
unsigned int getBase()
Definition: context.h:16
unsigned int getValue()