areaDetector
3-14
EPICS areaDetector framework
home
runner
work
areaDetector
areaDetector
ADCore
ADApp
pluginSrc
throttler.h
Go to the documentation of this file.
1
#ifndef THROTTLER_H
2
#define THROTTLER_H
3
4
#include <epicsTime.h>
5
6
class
Throttler
{
7
8
public
:
9
Throttler
(
double
limit=0.0);
10
void
reset
(
double
limit);
11
double
refill
();
12
bool
tryTake
(
double
tokens);
13
14
private
:
15
double
limit_;
// Max tokens per second
16
double
available_;
// Available tokens
17
double
refillAmount_;
// How much to refill every msec
18
epicsTimeStamp lastRefill_;
// When did the last refill happen
19
};
20
21
#endif
Throttler
Definition
throttler.h:6
Throttler::refill
double refill()
Definition
throttler.cpp:17
Throttler::reset
void reset(double limit)
Definition
throttler.cpp:10
Throttler::tryTake
bool tryTake(double tokens)
Definition
throttler.cpp:32
Generated by
1.9.8