refactor Message
message now provides an "isValid" property, data is implicitly shared now
This commit is contained in:
parent
64c371ebb0
commit
bf21ebc246
|
|
@ -30,6 +30,13 @@ Message &Message::operator=(const Message &other)
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Message::isValid() const
|
||||||
|
{
|
||||||
|
return d->deliveryTag != 0 &&
|
||||||
|
!d->exchangeName.isNull() &&
|
||||||
|
!d->routingKey.isNull();
|
||||||
|
}
|
||||||
|
|
||||||
qlonglong Message::deliveryTag() const
|
qlonglong Message::deliveryTag() const
|
||||||
{
|
{
|
||||||
return d->deliveryTag;
|
return d->deliveryTag;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QExplicitlySharedDataPointer>
|
#include <QSharedDataPointer>
|
||||||
|
|
||||||
#include "amqp_frame.h"
|
#include "amqp_frame.h"
|
||||||
#include "amqp_global.h"
|
#include "amqp_global.h"
|
||||||
|
|
@ -20,6 +20,8 @@ public:
|
||||||
Message &operator=(const Message &other);
|
Message &operator=(const Message &other);
|
||||||
~Message();
|
~Message();
|
||||||
|
|
||||||
|
bool isValid() const;
|
||||||
|
|
||||||
qlonglong deliveryTag() const;
|
qlonglong deliveryTag() const;
|
||||||
bool redelivered() const;
|
bool redelivered() const;
|
||||||
QString exchangeName() const;
|
QString exchangeName() const;
|
||||||
|
|
@ -29,7 +31,7 @@ public:
|
||||||
Frame::TableField headers() const;
|
Frame::TableField headers() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QExplicitlySharedDataPointer<MessagePrivate> d;
|
QSharedDataPointer<MessagePrivate> d;
|
||||||
friend class QueuePrivate;
|
friend class QueuePrivate;
|
||||||
friend class Queue;
|
friend class Queue;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue