Buteo Synchronization Framework
SyncQueue.h
1/*
2 * This file is part of buteo-syncfw package
3 *
4 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
5 *
6 * Contact: Sateesh Kavuri <sateesh.kavuri@nokia.com>
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * version 2.1 as published by the Free Software Foundation.
11 *
12 * This library is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA
21 *
22 */
23#ifndef SYNCQUEUE_H
24#define SYNCQUEUE_H
25
26#include <QQueue>
27
28namespace Buteo {
29
30class SyncSession;
31
38{
39public:
44 void enqueue(SyncSession *aSession);
45
50 SyncSession *dequeue(const QString &aProfileName);
51
57
63
68 bool isEmpty() const;
69
74 int size() const;
75
80 bool contains(const QString &aProfileName) const;
81
88
89private:
90 void sort();
91
92 QQueue<SyncSession *> iItems;
93};
94
95}
96
97#endif // SYNCQUEUE_H
Class for queuing sync sessions.
Definition SyncQueue.h:38
int size() const
Current size of the sync queue.
Definition SyncQueue.cpp:85
SyncSession * dequeue()
Removes the first item from the queue and returns it.
Definition SyncQueue.cpp:38
SyncSession * head()
Returns the first item in the queue but does not remove it.
Definition SyncQueue.cpp:66
bool isEmpty() const
Checks if the queue is empty.
Definition SyncQueue.cpp:78
const QList< SyncSession * > & getQueuedSyncSessions() const
Returns as a const reference, the list of all SyncSessions currently queued.
Definition SyncQueue.cpp:134
void enqueue(SyncSession *aSession)
Adds a new profile to the queue. Queue is sorted automatically.
Definition SyncQueue.cpp:30
bool contains(const QString &aProfileName) const
Checks if a profile with the given name is in the queue.
Definition SyncQueue.cpp:92
Class representing a single sync session.
Definition SyncSession.h:44
Definition SyncBackupAdaptor.h:40