diff options
| author | Charles E. Rolke <chug@apache.org> | 2011-04-07 20:40:10 +0000 |
|---|---|---|
| committer | Charles E. Rolke <chug@apache.org> | 2011-04-07 20:40:10 +0000 |
| commit | aba5b6b5ec8afab62f670a540a4ca2d61b76dc22 (patch) | |
| tree | 75e14a73b5c71707c91d87bd4099e1dc412d1b34 /cpp/bindings/qpid/dotnet/src/Message.cpp | |
| parent | 459748418ef7f64b62921934fc284840074f066d (diff) | |
| download | qpid-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/Message.cpp')
| -rw-r--r-- | cpp/bindings/qpid/dotnet/src/Message.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/cpp/bindings/qpid/dotnet/src/Message.cpp b/cpp/bindings/qpid/dotnet/src/Message.cpp index fe7825134d..e5dbf845b3 100644 --- a/cpp/bindings/qpid/dotnet/src/Message.cpp +++ b/cpp/bindings/qpid/dotnet/src/Message.cpp @@ -235,7 +235,7 @@ namespace Messaging { }
}
- // Copy constructor
+ // Copy constructor look-alike (C#)
Message::Message(const Message ^ message)
{
System::Exception ^ newException = nullptr;
@@ -257,7 +257,29 @@ namespace Messaging { }
}
- // Property
+ // Copy constructor implicitly dereferenced (C++)
+ Message::Message(const Message % message)
+ {
+ System::Exception ^ newException = nullptr;
+
+ try
+ {
+ messagep = new ::qpid::messaging::Message(
+ *(const_cast<Message %>(message).NativeMessage));
+ }
+ catch (const ::qpid::types::Exception & error)
+ {
+ String ^ errmsg = gcnew String(error.what());
+ newException = gcnew QpidException(errmsg);
+ }
+
+ if (newException != nullptr)
+ {
+ throw newException;
+ }
+ }
+
+ // Property
void Message::SetProperty(System::String ^ name, System::Object ^ value)
{
System::Exception ^ newException = nullptr;
|
