Buteo Synchronization Framework
BackgroundSync Class Reference

BackgroundSync implementation. More...

#include <BackgroundSync.h>

Inheritance diagram for BackgroundSync:

Public Slots

void onBackgroundSyncCompleted (QString aProfName)
 Called when background sync is completed.

Signals

void backgroundSyncRunning (QString aProfName)
 This signal will be emitted when a background sync timer for particular profile is triggered.
void backgroundSwitchRunning (const QString &aProfName)
 This signal will be emitted when a switch timer for particular profile is triggered.

Public Member Functions

 BackgroundSync (QObject *aParent)
 Constructor.
virtual ~BackgroundSync ()
 Destructor.
bool set (const QString &aProfName, int seconds, bool aExactTime=false)
 Schedules a background sync for this profile.
bool remove (const QString &aProfName)
 Removes background sync for a profile.
void removeAll ()
 Removes all background syncs for all profiles.
bool setSwitch (const QString &aProfName, const QDateTime &aSwitchTime)
 Schedules a switch(rush/off-rush) for a background sync running for this profile, the switch should be added after the background activity.
bool removeSwitch (const QString &aProfName)
 Removes a switch(rush/off-rush) for a profile.

Detailed Description

BackgroundSync implementation.

This class manages background syncs for different profiles.

Constructor & Destructor Documentation

◆ BackgroundSync()

BackgroundSync::BackgroundSync ( QObject * aParent)

Constructor.

Parameters
aParentParent object.

Member Function Documentation

◆ backgroundSwitchRunning

void BackgroundSync::backgroundSwitchRunning ( const QString & aProfName)
signal

This signal will be emitted when a switch timer for particular profile is triggered.

Parameters
aProfNameName of the profile for which switch timer is triggered.

◆ backgroundSyncRunning

void BackgroundSync::backgroundSyncRunning ( QString aProfName)
signal

This signal will be emitted when a background sync timer for particular profile is triggered.

Parameters
aProfNameName of the profile for which background sync timer is triggered.

◆ onBackgroundSyncCompleted

void BackgroundSync::onBackgroundSyncCompleted ( QString aProfName)
slot

Called when background sync is completed.

Parameters
aProfNameName of the profile for which background sync is completed.

◆ remove()

bool BackgroundSync::remove ( const QString & aProfName)

Removes background sync for a profile.

Parameters
aProfNameName of the profile.

◆ removeSwitch()

bool BackgroundSync::removeSwitch ( const QString & aProfName)

Removes a switch(rush/off-rush) for a profile.

Parameters
aProfNameName of the profile.

◆ set()

bool BackgroundSync::set ( const QString & aProfName,
int seconds,
bool aExactTime = false )

Schedules a background sync for this profile.

For interval based schedules the wakeup is mapped onto one of the platform frequency slots (see frequencyFromSeconds()), which are aligned to system-wide heartbeats and may fire well before or after the requested time. Explicit-time schedules (aExactTime == true) instead arm a one-shot wakeup range close to the requested moment, so the sync runs near the configured time rather than on a coarse frequency slot.

Parameters
aProfNameName of the profile.
secondsTime until the next scheduled sync, in seconds.
aExactTimeWhen true, wake up close to seconds using a wakeup range instead of a coarse frequency slot.
Returns
Success indicator.

◆ setSwitch()

bool BackgroundSync::setSwitch ( const QString & aProfName,
const QDateTime & aSwitchTime )

Schedules a switch(rush/off-rush) for a background sync running for this profile, the switch should be added after the background activity.

Parameters
aProfNameName of the profile.
aSwitchTimewhen the switch will occurs
Returns
Success indicator.

The documentation for this class was generated from the following files: