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;
|
||||
}
|
||||
|
||||
bool Message::isValid() const
|
||||
{
|
||||
return d->deliveryTag != 0 &&
|
||||
!d->exchangeName.isNull() &&
|
||||
!d->routingKey.isNull();
|
||||
}
|
||||
|
||||
qlonglong Message::deliveryTag() const
|
||||
{
|
||||
return d->deliveryTag;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include <QByteArray>
|
||||
#include <QHash>
|
||||
#include <QExplicitlySharedDataPointer>
|
||||
#include <QSharedDataPointer>
|
||||
|
||||
#include "amqp_frame.h"
|
||||
#include "amqp_global.h"
|
||||
|
|
@ -20,6 +20,8 @@ public:
|
|||
Message &operator=(const Message &other);
|
||||
~Message();
|
||||
|
||||
bool isValid() const;
|
||||
|
||||
qlonglong deliveryTag() const;
|
||||
bool redelivered() const;
|
||||
QString exchangeName() const;
|
||||
|
|
@ -29,7 +31,7 @@ public:
|
|||
Frame::TableField headers() const;
|
||||
|
||||
private:
|
||||
QExplicitlySharedDataPointer<MessagePrivate> d;
|
||||
QSharedDataPointer<MessagePrivate> d;
|
||||
friend class QueuePrivate;
|
||||
friend class Queue;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue