summaryrefslogtreecommitdiff
path: root/qpid/cpp/include
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2009-11-17 17:35:28 +0000
committerGordon Sim <gsim@apache.org>2009-11-17 17:35:28 +0000
commitdf29240dd9452a3972ed65693d00d970bd841533 (patch)
treed2927c3f072c0a1ac05e4f0cf704b261b17fb2ef /qpid/cpp/include
parent8fafe77990b8c97221d1013bcd119f16356a10bf (diff)
downloadqpid-python-df29240dd9452a3972ed65693d00d970bd841533.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@881395 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/include')
-rw-r--r--qpid/cpp/include/qpid/messaging/Receiver.h6
-rw-r--r--qpid/cpp/include/qpid/messaging/Sender.h7
-rw-r--r--qpid/cpp/include/qpid/messaging/Session.h7
3 files changed, 19 insertions, 1 deletions
diff --git a/qpid/cpp/include/qpid/messaging/Receiver.h b/qpid/cpp/include/qpid/messaging/Receiver.h
index 2dc62b1598..51630b12a2 100644
--- a/qpid/cpp/include/qpid/messaging/Receiver.h
+++ b/qpid/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<ReceiverImpl>
*/
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<Receiver>;
};
diff --git a/qpid/cpp/include/qpid/messaging/Sender.h b/qpid/cpp/include/qpid/messaging/Sender.h
index 29af3810f4..335e61260c 100644
--- a/qpid/cpp/include/qpid/messaging/Sender.h
+++ b/qpid/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<SenderImpl>
* 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<Sender>;
};
diff --git a/qpid/cpp/include/qpid/messaging/Session.h b/qpid/cpp/include/qpid/messaging/Session.h
index edb6fa6331..46372cb849 100644
--- a/qpid/cpp/include/qpid/messaging/Session.h
+++ b/qpid/cpp/include/qpid/messaging/Session.h
@@ -37,6 +37,7 @@ template <class> class PrivateImplRef;
namespace messaging {
class Address;
+class Connection;
class Message;
class MessageListener;
class Sender;
@@ -133,6 +134,12 @@ class Session : public qpid::client::Handle<SessionImpl>
* 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<Session>;
};