Buteo::SyncQueue Class Reference

Class for queuing sync sessions. More...

`#include <SyncQueue.h>`

## Public Member Functions

void | enqueue (SyncSession *aSession)
| Adds a new profile to the queue. Queue is sorted automatically.
SyncSession * | dequeue (const QString &aProfileName)
| Removes the sync session corresponding to the profile name and returns it.
SyncSession * | dequeue ()
| Removes the first item from the queue and returns it.
SyncSession * | head ()
| Returns the first item in the queue but does not remove it.
bool | isEmpty () const
| Checks if the queue is empty.
int | size () const
| Current size of the sync queue.
bool | contains (const QString &aProfileName) const
| Checks if a profile with the given name is in the queue.
const QList< SyncSession * > & | getQueuedSyncSessions () const
| Returns as a const reference, the list of all SyncSessions currently queued.

## Detailed Description

Class for queuing sync sessions.

The queue is sorted every time when new items are added to it, so that the sync sessions with highest priority will be at the front of the queue.

## Member Function Documentation

## contains()

bool SyncQueue::contains | ( | const QString & | aProfileName | ) | const

Checks if a profile with the given name is in the queue.

Returns
  Is the profile in the queue.

## dequeue() [1/2]

SyncSession * SyncQueue::dequeue | ( |  | ) |

Removes the first item from the queue and returns it.

Returns
  The removed item. NULL if the queue was empty.

## dequeue() [2/2]

SyncSession * SyncQueue::dequeue | ( | const QString & | aProfileName | ) |

Removes the sync session corresponding to the profile name and returns it.

Returns
  The removed item. NULL if the queue was empty.

## enqueue()

void SyncQueue::enqueue | ( | SyncSession * | aSession | ) |

Adds a new profile to the queue. Queue is sorted automatically.

Parameters

  aSession | Session to add to queue

## getQueuedSyncSessions()

const QList< SyncSession * > & SyncQueue::getQueuedSyncSessions | ( |  | ) | const

Returns as a const reference, the list of all SyncSessions currently queued.

Returns
  Is the profile in the queue.

## head()

SyncSession * SyncQueue::head | ( |  | ) |

Returns the first item in the queue but does not remove it.

Returns
  First item of the queue. NULL if the queue is empty.

## isEmpty()

bool SyncQueue::isEmpty | ( |  | ) | const

Checks if the queue is empty.

Returns
  Is the queue empty.

## size()

int SyncQueue::size | ( |  | ) | const

Current size of the sync queue.

Returns
  Number of elements in the sync queue.

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

- SyncQueue.h
- SyncQueue.cpp