Skip to content

class SyncManager

#include <flake/SyncManager.h>

Public Functions

Name
SyncManager(unsigned monthlyBudget_, unsigned remainingBudget_, int baseSyncInterval_, double eventBudgetFraction =0.5)
unsignedgetRemainingTotalBudget() const
unsignedgetTotalBudget() const
boolcanSyncRegular(unsigned expectedCost) const
voidrecordSync(unsigned actualDataConsumed)
voidrecordDataTransfer(unsigned actualDataConsumed)
voidresetMonthlyBudget()
intgetCurrentSyncInterval() const

Public Functions Documentation

function SyncManager

cpp
SyncManager(
    unsigned monthlyBudget_,
    unsigned remainingBudget_,
    int baseSyncInterval_,
    double eventBudgetFraction =0.5
)

function getRemainingTotalBudget

cpp
unsigned getRemainingTotalBudget() const

function getTotalBudget

cpp
unsigned getTotalBudget() const

function canSyncRegular

cpp
bool canSyncRegular(
    unsigned expectedCost
) const

function recordSync

cpp
void recordSync(
    unsigned actualDataConsumed
)

function recordDataTransfer

cpp
void recordDataTransfer(
    unsigned actualDataConsumed
)

function resetMonthlyBudget

cpp
void resetMonthlyBudget()

function getCurrentSyncInterval

cpp
int getCurrentSyncInterval() const