remove crufty unused functions, used constBegin/End for iterations, store itEnd during loop, various other cleanups
This commit is contained in:
parent
e325037fdd
commit
c6d0c57d5f
|
|
@ -109,7 +109,7 @@ void Channel::setQOS(qint32 prefetchSize, quint16 prefetchCount)
|
|||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int ChannelPrivate::nextChannelNumber_ = 0;
|
||||
ChannelPrivate::ChannelPrivate(Channel * q)
|
||||
ChannelPrivate::ChannelPrivate(Channel *q)
|
||||
: number(0),
|
||||
opened(false),
|
||||
needOpen(true),
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ public:
|
|||
METHOD_ID_ENUM(bmRecover, 110)
|
||||
};
|
||||
|
||||
ChannelPrivate(Channel * q);
|
||||
ChannelPrivate(Channel *q);
|
||||
virtual ~ChannelPrivate();
|
||||
|
||||
void init(int channelNumber, Client *parent);
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
using namespace QAMQP;
|
||||
|
||||
ClientPrivate::ClientPrivate(Client * q)
|
||||
ClientPrivate::ClientPrivate(Client *q)
|
||||
: port(AMQPPORT),
|
||||
host(QString::fromLatin1(AMQPHOST)),
|
||||
virtualHost(QString::fromLatin1(AMQPVHOST)),
|
||||
|
|
@ -24,10 +24,9 @@ ClientPrivate::~ClientPrivate()
|
|||
{
|
||||
}
|
||||
|
||||
void ClientPrivate::init(QObject *parent)
|
||||
void ClientPrivate::init(const QUrl &connectionString)
|
||||
{
|
||||
Q_Q(Client);
|
||||
q->setParent(parent);
|
||||
if (!network_) {
|
||||
network_ = new Network(q);
|
||||
QObject::connect(network_.data(), SIGNAL(connected()), q, SIGNAL(connected()));
|
||||
|
|
@ -38,42 +37,21 @@ void ClientPrivate::init(QObject *parent)
|
|||
connection_ = new Connection(q);
|
||||
network_->setMethodHandlerConnection(connection_);
|
||||
|
||||
setAuth(new AMQPlainAuthenticator(QString::fromLatin1(AMQPLOGIN), QString::fromLatin1(AMQPPSWD)));
|
||||
auth_ = QSharedPointer<Authenticator>(
|
||||
new AMQPlainAuthenticator(QString::fromLatin1(AMQPLOGIN), QString::fromLatin1(AMQPPSWD)));
|
||||
|
||||
QObject::connect(connection_, SIGNAL(connected()), q, SIGNAL(connected()));
|
||||
QObject::connect(connection_, SIGNAL(disconnected()), q, SIGNAL(disconnected()));
|
||||
}
|
||||
|
||||
void ClientPrivate::init(QObject *parent, const QUrl &connectionString)
|
||||
{
|
||||
init(parent);
|
||||
parseConnectionString(connectionString);
|
||||
connect();
|
||||
}
|
||||
|
||||
void ClientPrivate::setAuth(Authenticator *auth)
|
||||
{
|
||||
auth_ = QSharedPointer<Authenticator>(auth);
|
||||
}
|
||||
|
||||
void ClientPrivate::printConnect() const
|
||||
{
|
||||
QTextStream stream(stdout);
|
||||
stream << "port = " << port << endl;
|
||||
stream << "host = " << host << endl;
|
||||
stream << "vhost = " << virtualHost << endl;
|
||||
|
||||
if (auth_ && auth_->type() == QLatin1String("AMQPLAIN")) {
|
||||
QSharedPointer<AMQPlainAuthenticator> a = auth_.staticCast<AMQPlainAuthenticator>();
|
||||
stream << "user = " << a->login() << endl;
|
||||
stream << "passw = " << a->password() << endl;
|
||||
if (connectionString.isValid()) {
|
||||
parseConnectionString(connectionString);
|
||||
connect();
|
||||
}
|
||||
}
|
||||
|
||||
void ClientPrivate::connect()
|
||||
{
|
||||
sockConnect();
|
||||
login();
|
||||
}
|
||||
|
||||
void ClientPrivate::parseConnectionString(const QUrl &connectionString)
|
||||
|
|
@ -100,10 +78,6 @@ void ClientPrivate::sockConnect()
|
|||
network_->connectTo(host, port);
|
||||
}
|
||||
|
||||
void ClientPrivate::login()
|
||||
{
|
||||
}
|
||||
|
||||
void ClientPrivate::disconnect()
|
||||
{
|
||||
if (network_->state() == QAbstractSocket::UnconnectedState) {
|
||||
|
|
@ -121,13 +95,16 @@ Client::Client(QObject *parent)
|
|||
: QObject(parent),
|
||||
d_ptr(new ClientPrivate(this))
|
||||
{
|
||||
d_ptr->init(parent);
|
||||
Q_D(Client);
|
||||
d->init();
|
||||
}
|
||||
|
||||
Client::Client(const QUrl & connectionString, QObject * parent)
|
||||
: d_ptr(new ClientPrivate(this))
|
||||
Client::Client(const QUrl &connectionString, QObject *parent)
|
||||
: QObject(parent),
|
||||
d_ptr(new ClientPrivate(this))
|
||||
{
|
||||
d_ptr->init(parent, connectionString);
|
||||
Q_D(Client);
|
||||
d->init(connectionString);
|
||||
}
|
||||
|
||||
Client::~Client()
|
||||
|
|
@ -152,7 +129,7 @@ QString Client::host() const
|
|||
return d->host;
|
||||
}
|
||||
|
||||
void Client::setHost( const QString & host )
|
||||
void Client::setHost(const QString &host)
|
||||
{
|
||||
Q_D(Client);
|
||||
d->host = host;
|
||||
|
|
@ -173,9 +150,9 @@ void Client::setVirtualHost(const QString &virtualHost)
|
|||
QString Client::user() const
|
||||
{
|
||||
Q_D(const Client);
|
||||
const Authenticator * auth = d->auth_.data();
|
||||
const Authenticator *auth = d->auth_.data();
|
||||
if (auth && auth->type() == QLatin1String("AMQPLAIN")) {
|
||||
const AMQPlainAuthenticator * a = static_cast<const AMQPlainAuthenticator *>(auth);
|
||||
const AMQPlainAuthenticator *a = static_cast<const AMQPlainAuthenticator*>(auth);
|
||||
return a->login();
|
||||
}
|
||||
|
||||
|
|
@ -185,9 +162,9 @@ QString Client::user() const
|
|||
void Client::setUser(const QString &user)
|
||||
{
|
||||
Q_D(const Client);
|
||||
Authenticator * auth = d->auth_.data();
|
||||
Authenticator *auth = d->auth_.data();
|
||||
if (auth && auth->type() == QLatin1String("AMQPLAIN")) {
|
||||
AMQPlainAuthenticator * a = static_cast<AMQPlainAuthenticator *>(auth);
|
||||
AMQPlainAuthenticator *a = static_cast<AMQPlainAuthenticator*>(auth);
|
||||
a->setLogin(user);
|
||||
}
|
||||
}
|
||||
|
|
@ -195,9 +172,9 @@ void Client::setUser(const QString &user)
|
|||
QString Client::password() const
|
||||
{
|
||||
Q_D(const Client);
|
||||
const Authenticator * auth = d->auth_.data();
|
||||
const Authenticator *auth = d->auth_.data();
|
||||
if (auth && auth->type() == "AMQPLAIN") {
|
||||
const AMQPlainAuthenticator * a = static_cast<const AMQPlainAuthenticator *>(auth);
|
||||
const AMQPlainAuthenticator *a = static_cast<const AMQPlainAuthenticator*>(auth);
|
||||
return a->password();
|
||||
}
|
||||
|
||||
|
|
@ -209,23 +186,11 @@ void Client::setPassword(const QString &password)
|
|||
Q_D(Client);
|
||||
Authenticator *auth = d->auth_.data();
|
||||
if (auth && auth->type() == QLatin1String("AMQPLAIN")) {
|
||||
AMQPlainAuthenticator * a = static_cast<AMQPlainAuthenticator *>(auth);
|
||||
AMQPlainAuthenticator *a = static_cast<AMQPlainAuthenticator*>(auth);
|
||||
a->setPassword(password);
|
||||
}
|
||||
}
|
||||
|
||||
void Client::printConnect() const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
Q_D(const Client);
|
||||
d->printConnect();
|
||||
#endif // _DEBUG
|
||||
}
|
||||
|
||||
void Client::closeChannel()
|
||||
{
|
||||
}
|
||||
|
||||
Exchange *Client::createExchange(int channelNumber)
|
||||
{
|
||||
return createExchange(QString(), channelNumber);
|
||||
|
|
@ -269,7 +234,7 @@ Queue *Client::createQueue(const QString &name, int channelNumber)
|
|||
void Client::setAuth(Authenticator *auth)
|
||||
{
|
||||
Q_D(Client);
|
||||
d->setAuth(auth);
|
||||
d->auth_ = QSharedPointer<Authenticator>(auth);
|
||||
}
|
||||
|
||||
Authenticator *Client::auth() const
|
||||
|
|
|
|||
|
|
@ -32,9 +32,6 @@ public:
|
|||
Client(const QUrl &connectionString, QObject *parent = 0);
|
||||
~Client();
|
||||
|
||||
void printConnect() const;
|
||||
void closeChannel();
|
||||
|
||||
void addCustomProperty(const QString &name, const QString &value);
|
||||
QString customProperty(const QString &name) const;
|
||||
|
||||
|
|
|
|||
|
|
@ -18,16 +18,11 @@ public:
|
|||
ClientPrivate(Client *q);
|
||||
~ClientPrivate();
|
||||
|
||||
void init(QObject *parent);
|
||||
void init(QObject *parent, const QUrl &connectionString);
|
||||
|
||||
void printConnect() const;
|
||||
void init(const QUrl &connectionString = QUrl());
|
||||
void connect();
|
||||
void disconnect();
|
||||
void parseConnectionString( const QUrl &connectionString);
|
||||
void parseConnectionString(const QUrl &connectionString);
|
||||
void sockConnect();
|
||||
void login();
|
||||
void setAuth(Authenticator* auth);
|
||||
|
||||
quint32 port;
|
||||
QString host;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
using namespace QAMQP;
|
||||
|
||||
ConnectionPrivate::ConnectionPrivate(Connection * q)
|
||||
ConnectionPrivate::ConnectionPrivate(Connection *q)
|
||||
: closed_(false),
|
||||
connected(false),
|
||||
q_ptr(q)
|
||||
|
|
@ -22,7 +22,7 @@ ConnectionPrivate::~ConnectionPrivate()
|
|||
{
|
||||
}
|
||||
|
||||
void ConnectionPrivate::init(Client * parent)
|
||||
void ConnectionPrivate::init(Client *parent)
|
||||
{
|
||||
Q_Q(Connection);
|
||||
q->setParent(parent);
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ Q_SIGNALS:
|
|||
void connected();
|
||||
|
||||
private:
|
||||
explicit Connection(Client * parent = 0);
|
||||
explicit Connection(Client *parent = 0);
|
||||
|
||||
Q_DISABLE_COPY(Connection)
|
||||
Q_DECLARE_PRIVATE(Connection)
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ public:
|
|||
void secureOk();
|
||||
void tuneOk();
|
||||
void open();
|
||||
void close(int code, const QString & text, int classId = 0, int methodId = 0);
|
||||
void close(int code, const QString &text, int classId = 0, int methodId = 0);
|
||||
void closeOk();
|
||||
|
||||
void start(const Frame::Method &frame);
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ void Exchange::publish(const QByteArray &message, const QString &key,
|
|||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
ExchangePrivate::ExchangePrivate(Exchange * q)
|
||||
ExchangePrivate::ExchangePrivate(Exchange *q)
|
||||
: ChannelPrivate(q),
|
||||
delayedDeclare(false),
|
||||
declared(false)
|
||||
|
|
@ -201,7 +201,7 @@ void ExchangePrivate::remove(bool ifUnused, bool noWait)
|
|||
}
|
||||
|
||||
void ExchangePrivate::publish(const QByteArray &message, const QString &key,
|
||||
const QString &mimeType, const QVariantHash & headers,
|
||||
const QString &mimeType, const QVariantHash &headers,
|
||||
const Exchange::MessageProperties &prop)
|
||||
{
|
||||
Frame::Method frame(Frame::fcBasic, bmPublish);
|
||||
|
|
@ -224,10 +224,10 @@ void ExchangePrivate::publish(const QByteArray &message, const QString &key,
|
|||
content.setProperty(Frame::Content::cpHeaders, headers);
|
||||
content.setProperty(Frame::Content::cpMessageId, "0");
|
||||
|
||||
Exchange::MessageProperties::ConstIterator i;
|
||||
|
||||
for (i = prop.begin(); i != prop.end(); ++i)
|
||||
content.setProperty(i.key(), i.value());
|
||||
Exchange::MessageProperties::ConstIterator it;
|
||||
Exchange::MessageProperties::ConstIterator itEnd = prop.constEnd();
|
||||
for (it = prop.constBegin(); it != itEnd; ++it)
|
||||
content.setProperty(it.key(), it.value());
|
||||
|
||||
content.setBody(message);
|
||||
sendFrame(content);
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ protected:
|
|||
void onClose();
|
||||
|
||||
private:
|
||||
explicit Exchange(int channelNumber = -1, Client * parent = 0);
|
||||
explicit Exchange(int channelNumber = -1, Client *parent = 0);
|
||||
|
||||
Q_DISABLE_COPY(Exchange)
|
||||
Q_DECLARE_PRIVATE(Exchange)
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ public:
|
|||
METHOD_ID_ENUM(miDelete, 20)
|
||||
};
|
||||
|
||||
ExchangePrivate(Exchange * q);
|
||||
ExchangePrivate(Exchange *q);
|
||||
~ExchangePrivate();
|
||||
|
||||
void declare();
|
||||
|
|
|
|||
|
|
@ -285,7 +285,7 @@ QVariant Frame::readField(qint8 valueType, QDataStream &s)
|
|||
return value;
|
||||
}
|
||||
|
||||
QDataStream & Frame::deserialize(QDataStream &stream, Frame::TableField &f)
|
||||
QDataStream &Frame::deserialize(QDataStream &stream, Frame::TableField &f)
|
||||
{
|
||||
QByteArray data;
|
||||
stream >> data;
|
||||
|
|
@ -301,14 +301,15 @@ QDataStream & Frame::deserialize(QDataStream &stream, Frame::TableField &f)
|
|||
return stream;
|
||||
}
|
||||
|
||||
QDataStream & Frame::serialize(QDataStream &stream, const TableField &f)
|
||||
QDataStream &Frame::serialize(QDataStream &stream, const TableField &f)
|
||||
{
|
||||
QByteArray data;
|
||||
QDataStream s(&data, QIODevice::WriteOnly);
|
||||
TableField::ConstIterator i;
|
||||
for (i = f.begin(); i != f.end(); ++i) {
|
||||
writeField('s', s, i.key());
|
||||
writeField(s, i.value());
|
||||
TableField::ConstIterator it;
|
||||
TableField::ConstIterator itEnd = f.constEnd();
|
||||
for (it = f.constBegin(); it != itEnd; ++it) {
|
||||
writeField('s', s, it.key());
|
||||
writeField(s, it.value());
|
||||
}
|
||||
|
||||
if (data.isEmpty()) {
|
||||
|
|
@ -322,17 +323,18 @@ QDataStream & Frame::serialize(QDataStream &stream, const TableField &f)
|
|||
|
||||
void Frame::print(const TableField &f)
|
||||
{
|
||||
TableField::ConstIterator i;
|
||||
for (i = f.begin(); i != f.end(); ++i) {
|
||||
switch(i.value().type()) {
|
||||
TableField::ConstIterator it;
|
||||
TableField::ConstIterator itEnd = f.constEnd();
|
||||
for (it = f.constBegin(); it != itEnd; ++it) {
|
||||
switch(it.value().type()) {
|
||||
case QVariant::Hash:
|
||||
qDebug() << "\t" << qPrintable(i.key()) << ": FIELD_TABLE";
|
||||
qDebug() << "\t" << qPrintable(it.key()) << ": FIELD_TABLE";
|
||||
break;
|
||||
case QVariant::List:
|
||||
qDebug() << "\t" << qPrintable(i.key()) << ": ARRAY";
|
||||
qDebug() << "\t" << qPrintable(it.key()) << ": ARRAY";
|
||||
break;
|
||||
default:
|
||||
qDebug() << "\t" << qPrintable(i.key()) << ": " << i.value();
|
||||
qDebug() << "\t" << qPrintable(it.key()) << ": " << it.value();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,12 +87,12 @@ namespace Frame
|
|||
*/
|
||||
typedef QHash<QString, QVariant> TableField;
|
||||
|
||||
QDataStream & serialize( QDataStream & stream, const Frame::TableField & f );
|
||||
QDataStream & deserialize( QDataStream & stream, Frame::TableField & f );
|
||||
QVariant readField( qint8 valueType, QDataStream &s );
|
||||
void writeField( QDataStream &s, const QVariant & value );
|
||||
void writeField( qint8 valueType, QDataStream &s, const QVariant & value, bool withType = false );
|
||||
void print( const Frame::TableField & f );
|
||||
QDataStream &serialize(QDataStream &stream, const Frame::TableField &f);
|
||||
QDataStream &deserialize(QDataStream &stream, Frame::TableField &f);
|
||||
QVariant readField(qint8 valueType, QDataStream &s);
|
||||
void writeField(QDataStream &s, const QVariant &value);
|
||||
void writeField(qint8 valueType, QDataStream &s, const QVariant &value, bool withType = false);
|
||||
void print(const Frame::TableField &f);
|
||||
|
||||
/*
|
||||
* @brief Base class for any frames.
|
||||
|
|
@ -122,7 +122,7 @@ namespace Frame
|
|||
* @detailed Construct frame class from received raw data.
|
||||
* @param raw Data stream for reading source data.
|
||||
*/
|
||||
Base(QDataStream& raw);
|
||||
Base(QDataStream &raw);
|
||||
|
||||
/*
|
||||
* Base class virtual destructor
|
||||
|
|
@ -238,8 +238,8 @@ namespace Frame
|
|||
QByteArray arguments() const;
|
||||
|
||||
protected:
|
||||
void writePayload(QDataStream & stream) const;
|
||||
void readPayload(QDataStream & stream);
|
||||
void writePayload(QDataStream &stream) const;
|
||||
void readPayload(QDataStream &stream);
|
||||
short methodClass_;
|
||||
qint16 id_;
|
||||
QByteArray arguments_;
|
||||
|
|
@ -406,13 +406,13 @@ namespace Frame
|
|||
class QAMQP_EXPORT ContentHandler
|
||||
{
|
||||
public:
|
||||
virtual void _q_content(const Frame::Content & frame) = 0;
|
||||
virtual void _q_content(const Frame::Content &frame) = 0;
|
||||
};
|
||||
|
||||
class QAMQP_EXPORT ContentBodyHandler
|
||||
{
|
||||
public:
|
||||
virtual void _q_body(const Frame::ContentBody & frame) = 0;
|
||||
virtual void _q_body(const Frame::ContentBody &frame) = 0;
|
||||
};
|
||||
|
||||
} // namespace Frame
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
using namespace QAMQP;
|
||||
|
||||
Network::Network( QObject * parent)
|
||||
Network::Network(QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
qRegisterMetaType<Frame::Method>("QAMQP::Frame::Method");
|
||||
|
|
@ -22,7 +22,7 @@ Network::~Network()
|
|||
disconnect();
|
||||
}
|
||||
|
||||
void Network::connectTo(const QString & host, quint16 port)
|
||||
void Network::connectTo(const QString &host, quint16 port)
|
||||
{
|
||||
if(!socket_) {
|
||||
qWarning("AMQP: Socket didn't create.");
|
||||
|
|
@ -96,7 +96,7 @@ void Network::readyRead()
|
|||
if (socket_->bytesAvailable() >= readSize) {
|
||||
buffer_.resize(readSize);
|
||||
socket_->read(buffer_.data(), readSize);
|
||||
const char* bufferData = buffer_.constData();
|
||||
const char *bufferData = buffer_.constData();
|
||||
const quint8 type = *(quint8*)&bufferData[0];
|
||||
const quint8 magic = *(quint8*)&bufferData[Frame::HEADER_SIZE+payloadSize];
|
||||
if (magic != Frame::FRAME_END)
|
||||
|
|
@ -110,7 +110,7 @@ void Network::readyRead()
|
|||
if (frame.methodClass() == Frame::fcConnection) {
|
||||
m_pMethodHandlerConnection->_q_method(frame);
|
||||
} else {
|
||||
foreach(Frame::MethodHandler* pMethodHandler, m_methodHandlersByChannel[frame.channel()])
|
||||
foreach(Frame::MethodHandler *pMethodHandler, m_methodHandlersByChannel[frame.channel()])
|
||||
pMethodHandler->_q_method(frame);
|
||||
}
|
||||
}
|
||||
|
|
@ -118,14 +118,14 @@ void Network::readyRead()
|
|||
case Frame::ftHeader:
|
||||
{
|
||||
Frame::Content frame(streamB);
|
||||
foreach(Frame::ContentHandler* pMethodHandler, m_contentHandlerByChannel[frame.channel()])
|
||||
foreach(Frame::ContentHandler *pMethodHandler, m_contentHandlerByChannel[frame.channel()])
|
||||
pMethodHandler->_q_content(frame);
|
||||
}
|
||||
break;
|
||||
case Frame::ftBody:
|
||||
{
|
||||
Frame::ContentBody frame(streamB);
|
||||
foreach(Frame::ContentBodyHandler* pMethodHandler, m_bodyHandlersByChannel[frame.channel()])
|
||||
foreach(Frame::ContentBodyHandler *pMethodHandler, m_bodyHandlersByChannel[frame.channel()])
|
||||
pMethodHandler->_q_body(frame);
|
||||
}
|
||||
break;
|
||||
|
|
@ -171,7 +171,7 @@ void Network::initSocket(bool ssl)
|
|||
if (ssl) {
|
||||
#ifndef QT_NO_SSL
|
||||
socket_ = new QSslSocket(this);
|
||||
QSslSocket * ssl_= static_cast<QSslSocket*> (socket_.data());
|
||||
QSslSocket *ssl_= static_cast<QSslSocket*> (socket_.data());
|
||||
ssl_->setProtocol(QSsl::AnyProtocol);
|
||||
connect(socket_, SIGNAL(sslErrors(const QList<QSslError> &)), this, SLOT(sslErrors()));
|
||||
connect(socket_, SIGNAL(connected()), this, SLOT(conectionReady()));
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ void Queue::ack(const MessagePtr &message)
|
|||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
QueuePrivate::QueuePrivate(Queue * q)
|
||||
QueuePrivate::QueuePrivate(Queue *q)
|
||||
: ChannelPrivate(q),
|
||||
delayedDeclare(false),
|
||||
declared(false),
|
||||
|
|
@ -349,7 +349,7 @@ void QueuePrivate::purge()
|
|||
sendFrame(frame);
|
||||
}
|
||||
|
||||
void QueuePrivate::bind(const QString & exchangeName, const QString &key)
|
||||
void QueuePrivate::bind(const QString &exchangeName, const QString &key)
|
||||
{
|
||||
if (!opened) {
|
||||
delayedBindings.append(QPair<QString,QString>(exchangeName, key));
|
||||
|
|
@ -507,9 +507,10 @@ void QueuePrivate::_q_content(const Frame::Content &frame)
|
|||
|
||||
MessagePtr &message = messages_.last();
|
||||
message->leftSize = frame.bodySize();
|
||||
QHash<int, QVariant>::ConstIterator i;
|
||||
for (i = frame.properties_.begin(); i != frame.properties_.end(); ++i)
|
||||
message->property[Message::MessageProperty(i.key())]= i.value();
|
||||
QHash<int, QVariant>::ConstIterator it;
|
||||
QHash<int, QVariant>::ConstIterator itEnd = frame.properties_.constEnd();
|
||||
for (it = frame.properties_.constBegin(); it != itEnd; ++it)
|
||||
message->property[Message::MessageProperty(it.key())] = it.value();
|
||||
}
|
||||
|
||||
void QueuePrivate::_q_body(const Frame::ContentBody &frame)
|
||||
|
|
|
|||
|
|
@ -50,15 +50,15 @@ public:
|
|||
|
||||
void purge();
|
||||
|
||||
void bind(const QString & exchangeName, const QString & key);
|
||||
void bind(Exchange * exchange, const QString & key);
|
||||
void bind(const QString &exchangeName, const QString &key);
|
||||
void bind(Exchange *exchange, const QString &key);
|
||||
|
||||
void unbind(const QString & exchangeName, const QString & key);
|
||||
void unbind(Exchange * exchange, const QString & key);
|
||||
void unbind(const QString &exchangeName, const QString &key);
|
||||
void unbind(Exchange *exchange, const QString &key);
|
||||
|
||||
MessagePtr getMessage();
|
||||
void get();
|
||||
void ack(const MessagePtr & message);
|
||||
void ack(const MessagePtr &message);
|
||||
bool hasMessage() const;
|
||||
void consume(ConsumeOptions options = ConsumeOptions(NoOptions));
|
||||
void setConsumerTag(const QString &consumerTag);
|
||||
|
|
@ -79,10 +79,10 @@ protected:
|
|||
void onClose();
|
||||
|
||||
private:
|
||||
Queue(int channelNumber = -1, Client * parent = 0);
|
||||
Queue(int channelNumber = -1, Client *parent = 0);
|
||||
|
||||
void _q_content(const Frame::Content & frame);
|
||||
void _q_body(const Frame::ContentBody & frame);
|
||||
void _q_content(const Frame::Content &frame);
|
||||
void _q_body(const Frame::ContentBody &frame);
|
||||
|
||||
Q_DISABLE_COPY(Queue)
|
||||
Q_DECLARE_PRIVATE(Queue)
|
||||
|
|
|
|||
Loading…
Reference in New Issue