diff options
| author | Gordon Sim <gsim@apache.org> | 2009-11-17 17:35:28 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2009-11-17 17:35:28 +0000 |
| commit | 74c1740d54360bb4b091b5486c69f0f945d27abd (patch) | |
| tree | 4eded291096792a62ce1f6546ea01c6e1959f3c8 /cpp/src/qpid/client | |
| parent | 99c896bf60506c66f339d2ce51d4dca2725968af (diff) | |
| download | qpid-python-74c1740d54360bb4b091b5486c69f0f945d27abd.tar.gz | |
QPID-664: Add accessors for connection from session, and for session from sender/receiver.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@881395 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client')
| -rw-r--r-- | cpp/src/qpid/client/amqp0_10/ReceiverImpl.cpp | 6 | ||||
| -rw-r--r-- | cpp/src/qpid/client/amqp0_10/ReceiverImpl.h | 1 | ||||
| -rw-r--r-- | cpp/src/qpid/client/amqp0_10/SenderImpl.cpp | 6 | ||||
| -rw-r--r-- | cpp/src/qpid/client/amqp0_10/SenderImpl.h | 1 | ||||
| -rw-r--r-- | cpp/src/qpid/client/amqp0_10/SessionImpl.cpp | 6 | ||||
| -rw-r--r-- | cpp/src/qpid/client/amqp0_10/SessionImpl.h | 6 |
6 files changed, 23 insertions, 3 deletions
diff --git a/cpp/src/qpid/client/amqp0_10/ReceiverImpl.cpp b/cpp/src/qpid/client/amqp0_10/ReceiverImpl.cpp index fbaff7ec04..bc5c53fde6 100644 --- a/cpp/src/qpid/client/amqp0_10/ReceiverImpl.cpp +++ b/cpp/src/qpid/client/amqp0_10/ReceiverImpl.cpp @@ -23,6 +23,7 @@ #include "MessageSource.h" #include "SessionImpl.h" #include "qpid/messaging/Receiver.h" +#include "qpid/messaging/Session.h" namespace qpid { namespace client { @@ -185,6 +186,9 @@ void ReceiverImpl::setCapacityImpl(uint32_t c) } } } - +qpid::messaging::Session ReceiverImpl::getSession() const +{ + return qpid::messaging::Session(&parent); +} }}} // namespace qpid::client::amqp0_10 diff --git a/cpp/src/qpid/client/amqp0_10/ReceiverImpl.h b/cpp/src/qpid/client/amqp0_10/ReceiverImpl.h index 8033546c51..d40aac4058 100644 --- a/cpp/src/qpid/client/amqp0_10/ReceiverImpl.h +++ b/cpp/src/qpid/client/amqp0_10/ReceiverImpl.h @@ -63,6 +63,7 @@ class ReceiverImpl : public qpid::messaging::ReceiverImpl uint32_t available(); uint32_t pendingAck(); void received(qpid::messaging::Message& message); + qpid::messaging::Session getSession() const; private: SessionImpl& parent; const std::string destination; diff --git a/cpp/src/qpid/client/amqp0_10/SenderImpl.cpp b/cpp/src/qpid/client/amqp0_10/SenderImpl.cpp index ef16b26b91..24aaa054d2 100644 --- a/cpp/src/qpid/client/amqp0_10/SenderImpl.cpp +++ b/cpp/src/qpid/client/amqp0_10/SenderImpl.cpp @@ -23,6 +23,7 @@ #include "SessionImpl.h" #include "AddressResolution.h" #include "OutgoingMessage.h" +#include "qpid/messaging/Session.h" namespace qpid { namespace client { @@ -134,4 +135,9 @@ const std::string& SenderImpl::getName() const return name; } +qpid::messaging::Session SenderImpl::getSession() const +{ + return qpid::messaging::Session(&parent); +} + }}} // namespace qpid::client::amqp0_10 diff --git a/cpp/src/qpid/client/amqp0_10/SenderImpl.h b/cpp/src/qpid/client/amqp0_10/SenderImpl.h index 8140b3479a..80d9843d9e 100644 --- a/cpp/src/qpid/client/amqp0_10/SenderImpl.h +++ b/cpp/src/qpid/client/amqp0_10/SenderImpl.h @@ -55,6 +55,7 @@ class SenderImpl : public qpid::messaging::SenderImpl uint32_t pending(); void init(qpid::client::AsyncSession, AddressResolution&); const std::string& getName() const; + qpid::messaging::Session getSession() const; private: SessionImpl& parent; diff --git a/cpp/src/qpid/client/amqp0_10/SessionImpl.cpp b/cpp/src/qpid/client/amqp0_10/SessionImpl.cpp index 8545347b8c..0c09f26039 100644 --- a/cpp/src/qpid/client/amqp0_10/SessionImpl.cpp +++ b/cpp/src/qpid/client/amqp0_10/SessionImpl.cpp @@ -28,6 +28,7 @@ #include "qpid/Exception.h" #include "qpid/log/Statement.h" #include "qpid/messaging/Address.h" +#include "qpid/messaging/Connection.h" #include "qpid/messaging/Message.h" #include "qpid/messaging/MessageImpl.h" #include "qpid/messaging/Sender.h" @@ -424,4 +425,9 @@ void SessionImpl::reconnect() connection.reconnect(); } +qpid::messaging::Connection SessionImpl::getConnection() const +{ + return qpid::messaging::Connection(&connection); +} + }}} // namespace qpid::client::amqp0_10 diff --git a/cpp/src/qpid/client/amqp0_10/SessionImpl.h b/cpp/src/qpid/client/amqp0_10/SessionImpl.h index 872f66801d..30391fc0c5 100644 --- a/cpp/src/qpid/client/amqp0_10/SessionImpl.h +++ b/cpp/src/qpid/client/amqp0_10/SessionImpl.h @@ -32,8 +32,8 @@ namespace qpid { namespace messaging { -struct Address; -struct Filter; +class Address; +class Connection; class Message; class Receiver; class Sender; @@ -71,6 +71,8 @@ class SessionImpl : public qpid::messaging::SessionImpl bool nextReceiver(qpid::messaging::Receiver& receiver, qpid::sys::Duration timeout); qpid::messaging::Receiver nextReceiver(qpid::sys::Duration timeout); + qpid::messaging::Connection getConnection() const; + bool get(ReceiverImpl& receiver, qpid::messaging::Message& message, qpid::sys::Duration timeout); void receiverCancelled(const std::string& name); |
