2009-04-13 14:39:26 +02:00
|
|
|
/**
|
|
|
|
* This file is part of the KDE project
|
2009-06-02 20:02:06 +02:00
|
|
|
* Copyright (C) 2009 Kevin Ottens <ervin@kde.org>
|
2009-04-13 14:39:26 +02:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public License
|
|
|
|
* along with this library; see the file COPYING.LIB. If not, write to
|
|
|
|
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
2009-04-25 15:50:35 +02:00
|
|
|
#ifndef QTJOLIE_PENDINGCALL_P_H
|
|
|
|
#define QTJOLIE_PENDINGCALL_P_H
|
2009-04-13 14:39:26 +02:00
|
|
|
|
|
|
|
#include <QtCore/QEventLoop>
|
|
|
|
#include <QtCore/QObject>
|
|
|
|
#include <QtCore/QSharedData>
|
|
|
|
|
2009-04-25 15:50:35 +02:00
|
|
|
#include "message.h"
|
2009-04-13 14:39:26 +02:00
|
|
|
|
2009-04-25 15:50:35 +02:00
|
|
|
namespace Jolie
|
|
|
|
{
|
|
|
|
|
|
|
|
class PendingCallPrivate;
|
2009-06-02 20:02:06 +02:00
|
|
|
class PendingCallWatcher;
|
2009-04-13 14:39:26 +02:00
|
|
|
|
2009-04-25 15:50:35 +02:00
|
|
|
class PendingCallWaiter
|
2009-04-13 14:39:26 +02:00
|
|
|
{
|
|
|
|
public:
|
2009-04-25 15:50:35 +02:00
|
|
|
void waitForFinished(PendingCallPrivate *pendingCall);
|
2009-04-13 14:39:26 +02:00
|
|
|
|
|
|
|
private:
|
2009-04-25 15:50:35 +02:00
|
|
|
friend class PendingCallPrivate;
|
2009-04-13 14:39:26 +02:00
|
|
|
QEventLoop eventLoop;
|
|
|
|
};
|
|
|
|
|
2009-04-25 15:50:35 +02:00
|
|
|
class PendingCallPrivate : public QSharedData
|
2009-04-13 14:39:26 +02:00
|
|
|
{
|
|
|
|
public:
|
2009-04-25 15:50:35 +02:00
|
|
|
PendingCallPrivate(const Message &message)
|
2009-04-13 14:39:26 +02:00
|
|
|
: id(message.id()), isFinished(false) {}
|
|
|
|
|
2009-04-25 15:50:35 +02:00
|
|
|
void setReply(const Message &message);
|
2009-04-13 14:39:26 +02:00
|
|
|
|
|
|
|
private:
|
2009-04-25 15:50:35 +02:00
|
|
|
friend class PendingCall;
|
2009-06-02 20:02:06 +02:00
|
|
|
friend class PendingCallWatcher;
|
2009-04-25 15:50:35 +02:00
|
|
|
friend class PendingCallWaiter;
|
2009-04-13 14:39:26 +02:00
|
|
|
|
|
|
|
qint64 id;
|
|
|
|
bool isFinished;
|
2009-04-25 15:50:35 +02:00
|
|
|
Message reply;
|
|
|
|
QList<PendingCallWaiter*> waiters;
|
2009-06-02 20:02:06 +02:00
|
|
|
QList<PendingCallWatcher*> watchers;
|
2009-04-13 14:39:26 +02:00
|
|
|
};
|
|
|
|
|
2009-04-25 15:50:35 +02:00
|
|
|
} // namespace Jolie
|
2009-04-13 14:39:26 +02:00
|
|
|
|
|
|
|
#endif
|
2009-04-25 15:50:35 +02:00
|
|
|
|