From 74c1740d54360bb4b091b5486c69f0f945d27abd Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Tue, 17 Nov 2009 17:35:28 +0000 Subject: 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 --- cpp/include/qpid/messaging/Receiver.h | 6 ++++++ cpp/include/qpid/messaging/Sender.h | 7 ++++++- cpp/include/qpid/messaging/Session.h | 7 +++++++ 3 files changed, 19 insertions(+), 1 deletion(-) (limited to 'cpp/include') diff --git a/cpp/include/qpid/messaging/Receiver.h b/cpp/include/qpid/messaging/Receiver.h index 2dc62b1598..51630b12a2 100644 --- a/cpp/include/qpid/messaging/Receiver.h +++ b/cpp/include/qpid/messaging/Receiver.h @@ -37,6 +37,7 @@ namespace messaging { class Message; class ReceiverImpl; +class Session; /** * Interface through which messages are received. @@ -116,6 +117,11 @@ class Receiver : public qpid::client::Handle */ QPID_CLIENT_EXTERN const std::string& getName() const; + /** + * Returns a handle to the session associated with this receiver. + */ + QPID_CLIENT_EXTERN Session getSession() const; + private: friend class qpid::client::PrivateImplRef; }; diff --git a/cpp/include/qpid/messaging/Sender.h b/cpp/include/qpid/messaging/Sender.h index 29af3810f4..335e61260c 100644 --- a/cpp/include/qpid/messaging/Sender.h +++ b/cpp/include/qpid/messaging/Sender.h @@ -37,7 +37,7 @@ namespace messaging { class Message; class SenderImpl; - +class Session; /** * Interface through which messages are sent. */ @@ -73,6 +73,11 @@ class Sender : public qpid::client::Handle * Returns the name of this sender. */ QPID_CLIENT_EXTERN const std::string& getName() const; + + /** + * Returns a handle to the session associated with this sender. + */ + QPID_CLIENT_EXTERN Session getSession() const; private: friend class qpid::client::PrivateImplRef; }; diff --git a/cpp/include/qpid/messaging/Session.h b/cpp/include/qpid/messaging/Session.h index edb6fa6331..46372cb849 100644 --- a/cpp/include/qpid/messaging/Session.h +++ b/cpp/include/qpid/messaging/Session.h @@ -37,6 +37,7 @@ template class PrivateImplRef; namespace messaging { class Address; +class Connection; class Message; class MessageListener; class Sender; @@ -133,6 +134,12 @@ class Session : public qpid::client::Handle * if there is none for that name. */ QPID_CLIENT_EXTERN Receiver getReceiver(const std::string& name) const; + /** + * Returns a handle to the connection this session is associated + * with. + */ + QPID_CLIENT_EXTERN Connection getConnection() const; + private: friend class qpid::client::PrivateImplRef; }; -- cgit v1.2.1