2014-08-27 03:05:39 +08:00
|
|
|
#ifndef QAMQPQUEUE_P_H
|
|
|
|
|
#define QAMQPQUEUE_P_H
|
2014-05-29 00:25:28 +08:00
|
|
|
|
2014-05-29 01:52:27 +08:00
|
|
|
#include <QQueue>
|
2014-06-19 22:01:47 +08:00
|
|
|
#include <QStringList>
|
|
|
|
|
|
2014-08-27 03:05:39 +08:00
|
|
|
#include "qamqpchannel_p.h"
|
2014-05-29 01:52:27 +08:00
|
|
|
|
2014-09-15 23:51:48 +08:00
|
|
|
class QAmqpQueuePrivate: public QAmqpChannelPrivate,
|
|
|
|
|
public QAmqpContentFrameHandler,
|
|
|
|
|
public QAmqpContentBodyFrameHandler
|
2014-05-29 00:25:28 +08:00
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
enum MethodId {
|
|
|
|
|
METHOD_ID_ENUM(miDeclare, 10),
|
|
|
|
|
METHOD_ID_ENUM(miBind, 20),
|
|
|
|
|
METHOD_ID_ENUM(miUnbind, 50),
|
|
|
|
|
METHOD_ID_ENUM(miPurge, 30),
|
|
|
|
|
METHOD_ID_ENUM(miDelete, 40)
|
|
|
|
|
};
|
|
|
|
|
|
2014-09-15 23:51:48 +08:00
|
|
|
QAmqpQueuePrivate(QAmqpQueue *q);
|
|
|
|
|
~QAmqpQueuePrivate();
|
2014-05-29 00:25:28 +08:00
|
|
|
|
2014-06-07 00:10:51 +08:00
|
|
|
void declare();
|
2014-09-15 23:51:48 +08:00
|
|
|
virtual bool _q_method(const QAmqpMethodFrame &frame);
|
2014-06-24 23:09:19 +08:00
|
|
|
|
|
|
|
|
// AMQP Queue method handlers
|
2014-09-15 23:51:48 +08:00
|
|
|
void declareOk(const QAmqpMethodFrame &frame);
|
|
|
|
|
void deleteOk(const QAmqpMethodFrame &frame);
|
|
|
|
|
void purgeOk(const QAmqpMethodFrame &frame);
|
|
|
|
|
void bindOk(const QAmqpMethodFrame &frame);
|
|
|
|
|
void unbindOk(const QAmqpMethodFrame &frame);
|
|
|
|
|
void consumeOk(const QAmqpMethodFrame &frame);
|
2014-06-24 23:09:19 +08:00
|
|
|
|
|
|
|
|
// AMQP Basic method handlers
|
2014-09-15 23:51:48 +08:00
|
|
|
virtual void _q_content(const QAmqpContentFrame &frame);
|
|
|
|
|
virtual void _q_body(const QAmqpContentBodyFrame &frame);
|
|
|
|
|
void deliver(const QAmqpMethodFrame &frame);
|
|
|
|
|
void getOk(const QAmqpMethodFrame &frame);
|
|
|
|
|
void cancelOk(const QAmqpMethodFrame &frame);
|
2014-05-29 00:25:28 +08:00
|
|
|
|
|
|
|
|
QString type;
|
2014-06-07 00:10:51 +08:00
|
|
|
int options;
|
2014-05-29 00:25:28 +08:00
|
|
|
bool delayedDeclare;
|
|
|
|
|
bool declared;
|
|
|
|
|
QQueue<QPair<QString, QString> > delayedBindings;
|
2014-06-25 09:09:45 +08:00
|
|
|
|
|
|
|
|
QString consumerTag;
|
2014-05-29 00:25:28 +08:00
|
|
|
bool recievingMessage;
|
2014-09-15 23:51:48 +08:00
|
|
|
QAmqpMessage currentMessage;
|
2014-06-24 22:30:05 +08:00
|
|
|
bool consuming;
|
2015-04-06 22:25:56 +08:00
|
|
|
bool consumeRequested;
|
2014-05-29 00:25:28 +08:00
|
|
|
|
2014-09-15 23:51:48 +08:00
|
|
|
Q_DECLARE_PUBLIC(QAmqpQueue)
|
2014-05-29 00:25:28 +08:00
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
2014-08-27 03:05:39 +08:00
|
|
|
#endif // QAMQPQUEUE_P_H
|