qamqp/src/amqp_queue_p.h

68 lines
1.7 KiB
C
Raw Normal View History

#ifndef amqp_queue_p_h__
#define amqp_queue_p_h__
2014-05-29 01:52:27 +08:00
#include <QQueue>
#include "amqp_channel_p.h"
2014-05-29 01:52:27 +08:00
#define METHOD_ID_ENUM(name, id) name = id, name ## Ok
namespace QAMQP
{
class QueuePrivate: public ChannelPrivate
{
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)
};
QueuePrivate(Queue *q);
~QueuePrivate();
void declare();
void remove(bool ifUnused = true, bool ifEmpty = true, bool noWait = true);
void bind(const QString &exchangeName, const QString &key);
void unbind(const QString &exchangeName, const QString &key);
2014-05-29 01:52:27 +08:00
void declareOk(const Frame::Method &frame);
void deleteOk(const Frame::Method &frame);
void bindOk(const Frame::Method &frame);
void unbindOk(const Frame::Method &frame);
/************************************************************************/
/* CLASS BASIC METHODS */
/************************************************************************/
2014-05-29 01:52:27 +08:00
void consumeOk(const Frame::Method &frame);
void deliver(const Frame::Method &frame);
void get();
2014-05-29 01:52:27 +08:00
void getOk(const Frame::Method &frame);
QString type;
Queue::QueueOptions options;
virtual bool _q_method(const Frame::Method &frame);
bool delayedDeclare;
bool declared;
bool noAck;
QString consumerTag;
QQueue<QPair<QString, QString> > delayedBindings;
2014-05-29 01:52:27 +08:00
QQueue<MessagePtr> messages_;
bool recievingMessage;
2014-05-29 01:52:27 +08:00
Q_DECLARE_PUBLIC(Queue)
};
2014-05-29 01:52:27 +08:00
} // namespace QAMQP
#endif // amqp_queue_p_h__