diff options
Diffstat (limited to 'qpid/cpp/bindings/qpid/dotnet/src/Session.cpp')
-rw-r--r-- | qpid/cpp/bindings/qpid/dotnet/src/Session.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/qpid/cpp/bindings/qpid/dotnet/src/Session.cpp b/qpid/cpp/bindings/qpid/dotnet/src/Session.cpp index 880331c588..4a6199f108 100644 --- a/qpid/cpp/bindings/qpid/dotnet/src/Session.cpp +++ b/qpid/cpp/bindings/qpid/dotnet/src/Session.cpp @@ -89,7 +89,7 @@ namespace Messaging { }
- // Copy constructor
+ // Copy constructor look-alike (C#)
Session::Session(const Session ^ session)
: parentConnectionp(session->parentConnectionp)
{
@@ -113,6 +113,30 @@ namespace Messaging { }
}
+ // Copy constructor implicitly dereferenced (C++)
+ Session::Session(const Session % session)
+ : parentConnectionp(session.parentConnectionp)
+ {
+ System::Exception ^ newException = nullptr;
+
+ try
+ {
+ sessionp = new ::qpid::messaging::Session(
+ *(const_cast<Session %>(session).NativeSession));
+
+ }
+ catch (const ::qpid::types::Exception & error)
+ {
+ String ^ errmsg = gcnew String(error.what());
+ newException = gcnew QpidException(errmsg);
+ }
+
+ if (newException != nullptr)
+ {
+ throw newException;
+ }
+ }
+
void Session::Close()
{
|