refactor: a new line was missing

This commit is contained in:
hensels 2023-05-08 12:15:54 +02:00
parent 6cc6bbcdfa
commit d912bddfce
1 changed files with 127 additions and 126 deletions

View File

@ -1,126 +1,127 @@
/* /*
* Copyright (C) 2012-2014 Alexey Shcherbakov * Copyright (C) 2012-2014 Alexey Shcherbakov
* Copyright (C) 2014-2015 Matt Broadstone * Copyright (C) 2014-2015 Matt Broadstone
* Contact: https://github.com/mbroadst/qamqp * Contact: https://github.com/mbroadst/qamqp
* *
* This file is part of the QAMQP Library. * This file is part of the QAMQP Library.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
*/ */
#ifndef QAMQPQUEUE_H #ifndef QAMQPQUEUE_H
#define QAMQPQUEUE_H #define QAMQPQUEUE_H
#include <QQueue> #include <QQueue>
#include "qamqpchannel.h" #include "qamqpchannel.h"
#include "qamqpmessage.h" #include "qamqpmessage.h"
#include "qamqpglobal.h" #include "qamqpglobal.h"
#include "qamqptable.h" #include "qamqptable.h"
class QAmqpClient; class QAmqpClient;
class QAmqpClientPrivate; class QAmqpClientPrivate;
class QAmqpExchange; class QAmqpExchange;
class QAmqpQueuePrivate; class QAmqpQueuePrivate;
class QAMQP_EXPORT QAmqpQueue : public QAmqpChannel, public QQueue<QAmqpMessage> class QAMQP_EXPORT QAmqpQueue : public QAmqpChannel, public QQueue<QAmqpMessage>
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(int options READ options CONSTANT) Q_PROPERTY(int options READ options CONSTANT)
Q_PROPERTY(QString consumerTag READ consumerTag WRITE setConsumerTag) Q_PROPERTY(QString consumerTag READ consumerTag WRITE setConsumerTag)
public: public:
enum QueueOption { enum QueueOption {
NoOptions = 0x0, NoOptions = 0x0,
Passive = 0x01, Passive = 0x01,
Durable = 0x02, Durable = 0x02,
Exclusive = 0x04, Exclusive = 0x04,
AutoDelete = 0x08, AutoDelete = 0x08,
NoWait = 0x10 NoWait = 0x10
}; };
Q_DECLARE_FLAGS(QueueOptions, QueueOption) Q_DECLARE_FLAGS(QueueOptions, QueueOption)
Q_ENUM(QueueOption) Q_ENUM(QueueOption)
Q_ENUM(QueueOptions) int options() const; Q_ENUM(QueueOptions)
int options() const;
enum ConsumeOption {
coNoLocal = 0x01, enum ConsumeOption {
coNoAck = 0x02, coNoLocal = 0x01,
coExclusive = 0x04, coNoAck = 0x02,
coNoWait = 0x08 coExclusive = 0x04,
}; coNoWait = 0x08
Q_DECLARE_FLAGS(ConsumeOptions, ConsumeOption) };
Q_ENUM(ConsumeOption) Q_DECLARE_FLAGS(ConsumeOptions, ConsumeOption)
Q_ENUM(ConsumeOption)
enum RemoveOption {
roForce = 0x0, enum RemoveOption {
roIfUnused = 0x01, roForce = 0x0,
roIfEmpty = 0x02, roIfUnused = 0x01,
roNoWait = 0x04 roIfEmpty = 0x02,
}; roNoWait = 0x04
Q_DECLARE_FLAGS(RemoveOptions, RemoveOption) };
Q_ENUM(RemoveOption) Q_DECLARE_FLAGS(RemoveOptions, RemoveOption)
Q_ENUM(RemoveOption)
~QAmqpQueue();
~QAmqpQueue();
bool isConsuming() const;
bool isDeclared() const; bool isConsuming() const;
bool isDeclared() const;
void setConsumerTag(const QString &consumerTag);
QString consumerTag() const; void setConsumerTag(const QString &consumerTag);
QString consumerTag() const;
qint32 messageCount() const;
qint32 consumerCount() const; qint32 messageCount() const;
qint32 consumerCount() const;
Q_SIGNALS:
void declared(); Q_SIGNALS:
void bound(); void declared();
void unbound(); void bound();
void removed(); void unbound();
void purged(int messageCount); void removed();
void purged(int messageCount);
void messageReceived();
void empty(); void messageReceived();
void consuming(const QString &consumerTag); void empty();
void cancelled(const QString &consumerTag); void consuming(const QString &consumerTag);
void cancelled(const QString &consumerTag);
public Q_SLOTS:
// AMQP Queue public Q_SLOTS:
void declare(int options = Durable|AutoDelete, const QAmqpTable &arguments = QAmqpTable()); // AMQP Queue
void bind(const QString &exchangeName, const QString &key); void declare(int options = Durable|AutoDelete, const QAmqpTable &arguments = QAmqpTable());
void bind(QAmqpExchange *exchange, const QString &key); void bind(const QString &exchangeName, const QString &key);
void unbind(const QString &exchangeName, const QString &key); void bind(QAmqpExchange *exchange, const QString &key);
void unbind(QAmqpExchange *exchange, const QString &key); void unbind(const QString &exchangeName, const QString &key);
void purge(); void unbind(QAmqpExchange *exchange, const QString &key);
void remove(int options = roIfUnused|roIfEmpty|roNoWait); void purge();
void remove(int options = roIfUnused|roIfEmpty|roNoWait);
// AMQP Basic
bool consume(int options = NoOptions); // AMQP Basic
void get(bool noAck = true); bool consume(int options = NoOptions);
bool cancel(bool noWait = false); void get(bool noAck = true);
void ack(const QAmqpMessage &message); bool cancel(bool noWait = false);
void ack(qlonglong deliveryTag, bool multiple); void ack(const QAmqpMessage &message);
void reject(const QAmqpMessage &message, bool requeue); void ack(qlonglong deliveryTag, bool multiple);
void reject(qlonglong deliveryTag, bool requeue); void reject(const QAmqpMessage &message, bool requeue);
void reject(qlonglong deliveryTag, bool requeue);
protected:
// reimp Channel protected:
virtual void channelOpened(); // reimp Channel
virtual void channelClosed(); virtual void channelOpened();
virtual void channelClosed();
private:
explicit QAmqpQueue(int channelNumber = -1, QAmqpClient *parent = 0); private:
explicit QAmqpQueue(int channelNumber = -1, QAmqpClient *parent = 0);
Q_DISABLE_COPY(QAmqpQueue)
Q_DECLARE_PRIVATE(QAmqpQueue) Q_DISABLE_COPY(QAmqpQueue)
friend class QAmqpClient; Q_DECLARE_PRIVATE(QAmqpQueue)
friend class QAmqpClientPrivate; friend class QAmqpClient;
friend class QAmqpClientPrivate;
};
};
#endif // QAMQPQUEUE_H
#endif // QAMQPQUEUE_H