summaryrefslogtreecommitdiff
path: root/cpp/bindings/qpid/dotnet/src/Connection.cpp
diff options
context:
space:
mode:
authorCharles E. Rolke <chug@apache.org>2011-04-07 20:40:10 +0000
committerCharles E. Rolke <chug@apache.org>2011-04-07 20:40:10 +0000
commitaba5b6b5ec8afab62f670a540a4ca2d61b76dc22 (patch)
tree75e14a73b5c71707c91d87bd4099e1dc412d1b34 /cpp/bindings/qpid/dotnet/src/Connection.cpp
parent459748418ef7f64b62921934fc284840074f066d (diff)
downloadqpid-python-aba5b6b5ec8afab62f670a540a4ca2d61b76dc22.tar.gz
QPID-3192 .NET Binding for Messaging classes are missing intrinsic copy constructors.
The existing 'T(const T ^)' constructor is useful for C# code but fails for Cpp/clr. This commit adds the 'T(const T %)' intrinsic copy constructor for Cpp/clr. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1089995 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/bindings/qpid/dotnet/src/Connection.cpp')
-rw-r--r--cpp/bindings/qpid/dotnet/src/Connection.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/cpp/bindings/qpid/dotnet/src/Connection.cpp b/cpp/bindings/qpid/dotnet/src/Connection.cpp
index 69ace7db52..12c0e29f74 100644
--- a/cpp/bindings/qpid/dotnet/src/Connection.cpp
+++ b/cpp/bindings/qpid/dotnet/src/Connection.cpp
@@ -114,7 +114,7 @@ namespace Messaging {
}
- // Copy constructor
+ // Copy constructor look-alike (C#)
Connection::Connection(const Connection ^ connection)
{
System::Exception ^ newException = nullptr;
@@ -136,6 +136,28 @@ namespace Messaging {
}
}
+ // Copy constructor implicitly dereferenced (C++)
+ Connection::Connection(const Connection % connection)
+ {
+ System::Exception ^ newException = nullptr;
+
+ try
+ {
+ connectionp = new ::qpid::messaging::Connection(
+ *(const_cast<Connection %>(connection).NativeConnection));
+ }
+ catch (const ::qpid::types::Exception & error)
+ {
+ String ^ errmsg = gcnew String(error.what());
+ newException = gcnew QpidException(errmsg);
+ }
+
+ if (newException != nullptr)
+ {
+ throw newException;
+ }
+ }
+
// Destructor
Connection::~Connection()