From 56cf23dc21b5787a4b567afe5b83c3e5504071e6 Mon Sep 17 00:00:00 2001 From: Ted Ross Date: Mon, 19 Jul 2010 19:51:47 +0000 Subject: QPID-2589 - Patch from Chuck Rolke This patch cleans up or adds the copy constructors and the copy assignment operators for the binding classes. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@965603 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/bindings/qpid/dotnet/src/Session.h | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'cpp/bindings/qpid/dotnet/src/Session.h') diff --git a/cpp/bindings/qpid/dotnet/src/Session.h b/cpp/bindings/qpid/dotnet/src/Session.h index a5affc67b6..e07725247b 100644 --- a/cpp/bindings/qpid/dotnet/src/Session.h +++ b/cpp/bindings/qpid/dotnet/src/Session.h @@ -67,9 +67,33 @@ namespace Messaging { public: Session(::qpid::messaging::Session * sessionp, Connection ^ connRef); + + // copy constructor + Session(const Session ^ session); + ~Session(); !Session(); - Session(const Session % rhs); + + // assignment operator + Session % operator=(const Session % rhs) + { + if (this == %rhs) + { + // Self assignment, do nothing + } + else + { + delete sessionp; + sessionp = new ::qpid::messaging::Session( + *(const_cast(rhs).NativeSession) ); + } + return *this; + } + + property ::qpid::messaging::Session * NativeSession + { + ::qpid::messaging::Session * get () { return sessionp; } + } void Close(); void Commit(); -- cgit v1.2.1