AFV initial commit

This commit is contained in:
Roland Rossgotterer
2019-09-14 21:18:26 +02:00
committed by Mat Sutcliffe
parent 7030302e73
commit b5a2f2ad13
100 changed files with 6821 additions and 25 deletions

View File

@@ -0,0 +1,32 @@
#ifndef CALLSIGNDELAYCACHE_H
#define CALLSIGNDELAYCACHE_H
#include <QHash>
#include <QString>
class CallsignDelayCache
{
public:
void initialise(const QString &callsign);
int get(const QString &callsign);
void underflow(const QString &callsign);
void success(const QString &callsign);
void increaseDelayMs(const QString &callsign);
void decreaseDelayMs(const QString &callsign);
static CallsignDelayCache &instance();
private:
CallsignDelayCache() = default;
static constexpr int delayDefault = 60;
static constexpr int delayMin = 40;
static constexpr int delayIncrement = 20;
static constexpr int delayMax = 300;
QHash<QString, int> m_delayCache;
QHash<QString, int> successfulTransmissionsCache;
};
#endif // CALLSIGNDELAYCACHE_H