From f83677056891e436bf5ba99e79240df2a44528cd Mon Sep 17 00:00:00 2001 From: "Stephen D. Huston" Date: Fri, 21 Oct 2011 14:42:12 +0000 Subject: Merged out from trunk git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/QPID-2519@1187375 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/bindings/qpid/dotnet/configure-windows.ps1 | 108 ++++++++++++++++----- .../Properties/AssemblyInfo.cs | 16 +-- .../Properties/AssemblyInfo.cs | 16 +-- .../Properties/AssemblyInfo.cs | 12 +-- .../Properties/AssemblyInfo.cs | 2 +- .../csharp.map.receiver/Properties/AssemblyInfo.cs | 16 +-- .../csharp.map.sender/Properties/AssemblyInfo.cs | 16 +-- .../MyProject/AssemblyInfo.vb | 30 +++--- .../org.apache.qpid.messaging.sessionreceiver.sln | 6 +- cpp/bindings/qpid/dotnet/src/Address.cpp | 24 ++++- cpp/bindings/qpid/dotnet/src/Address.h | 1 + cpp/bindings/qpid/dotnet/src/Connection.cpp | 24 ++++- cpp/bindings/qpid/dotnet/src/Connection.h | 1 + cpp/bindings/qpid/dotnet/src/Duration.h | 12 ++- cpp/bindings/qpid/dotnet/src/FailoverUpdates.h | 1 + cpp/bindings/qpid/dotnet/src/Message.cpp | 26 ++++- cpp/bindings/qpid/dotnet/src/Message.h | 1 + cpp/bindings/qpid/dotnet/src/Receiver.cpp | 25 ++++- cpp/bindings/qpid/dotnet/src/Receiver.h | 1 + cpp/bindings/qpid/dotnet/src/Sender.cpp | 25 ++++- cpp/bindings/qpid/dotnet/src/Sender.h | 1 + cpp/bindings/qpid/dotnet/src/Session.cpp | 51 +++++++++- cpp/bindings/qpid/dotnet/src/Session.h | 3 + .../test/messaging.test/Properties/AssemblyInfo.cs | 16 +-- 24 files changed, 339 insertions(+), 95 deletions(-) (limited to 'cpp/bindings/qpid/dotnet') diff --git a/cpp/bindings/qpid/dotnet/configure-windows.ps1 b/cpp/bindings/qpid/dotnet/configure-windows.ps1 index 34395911b9..23fc742e07 100644 --- a/cpp/bindings/qpid/dotnet/configure-windows.ps1 +++ b/cpp/bindings/qpid/dotnet/configure-windows.ps1 @@ -24,29 +24,32 @@ # This script configures a qpid\cpp developer build environment under Windows # to enable working with cpp\bindings\qpid\dotnet binding source code. # +# * Supports multiple versions of Visual Studio (VS2008, VS2010) as CMake +# generator. +# # * Supports 32-bit and/or 64-bit development platforms. # # * User chooses in-source or out-of-source build directories. # # - 'In-source' builds happen when CMake is run from directory qpid\cpp. -# Hundreds of CMake-generated output files are placed in qpid\cpp\src. +# Hundreds of CMake-generated output files are placed in qpid\cpp\src. # These files go right on top of files that are part of the source tree # in qpid\cpp\src. -# In-source builds support only one platform. +# In-source builds support only one platform. # Choose only a 32-bit or a 64-bit platform but not both. # # - Out-of-source builds happen when the user chooses another directory # under qpid in which to run CMake. Out-of-source builds are required -# in order to build both x86 and x64 targets using the same source tree. +# in order to build both x86 and x64 targets using the same source tree. # For each build platform (32-bit x86 or Win32, or 64-bit x64) the user -# specifies a build directory and a specific version of Boost. +# specifies a build directory and a specific version of Boost. # Many platform/Boost-version directories may reside side by side. # # * User chooses to run CMake or not. # # - When a new build directory is created then the user is given the -# option of running CMake in that directory. Running CMake is a -# necessary step as CMake creates important source, solution, and +# option of running CMake in that directory. Running CMake is a +# necessary step as CMake creates important source, solution, and # project files. # # - If a directory "looks like" is has already had CMake run in it @@ -63,7 +66,7 @@ # 3. CMake 2.8 (or later) must be installed. The cmake\bin directory # must be in the user's path. # 4. Boost library specifications may or may not be in the user's path. -# The script author recommeds not to have Boost in the path and only +# The script author recommeds not to have Boost in the path and only # allow the Boost path to be specified by generated command procedures. # 5. Visual Studio build environment must be installed. # @@ -90,7 +93,7 @@ # In this example the build dirs are new. The script will prompt # asking if CMake is to run in the build directories. User chooses Yes. # -# Now this script runs CMake twice, once each with the 32-bit and 64-bit +# Now this script runs CMake twice, once each with the 32-bit and 64-bit # generators. # * This step creates qpid-cpp.sln and related project files. # C:\svn\qpid\build32\qpid-cpp.sln @@ -107,7 +110,7 @@ # C:\svn\qpid\build64\setenv-messaging-x64-64bit.bat # # Next the user compiles solution qpid\build32\qpid-cpp.sln. -# +# # Using the generated scripts: # # Case 1. Run an executable in 32-bit mode. @@ -142,6 +145,11 @@ $global:txtPath = '$env:PATH' $global:txtQR = '$env:QPID_BUILD_ROOT' $global:txtWH = 'Write-Host' +############################# +# Visual Studio version selection dialog items and choice +# +[array]$global:VsVersionCmakeChoiceList = "Visual Studio 10", "Visual Studio 9 2008" +$global:cmakeGenerator = '' ############################# # Select-Folder @@ -168,7 +176,7 @@ function AskYesOrNo ($Question="No question?", $Title="No Title?") [Windows.Forms.MessageBoxIcon]::Question) $result = $dlg -eq [Windows.Forms.DialogResult]::Yes - + $result } @@ -188,7 +196,7 @@ function SanityCheckBoostPath ($path=0) $toTest = ('include', 'lib') foreach ($pattern in $toTest) { - $target = Join-Path $path $pattern + $target = Join-Path $path $pattern if (!(Test-Path -path $target)) { $result = $false } @@ -196,7 +204,7 @@ function SanityCheckBoostPath ($path=0) } else { $result = $false } - + if (! $result) { Write-Host "The path ""$displayPath"" does not appear to be a Boost root path." } @@ -219,7 +227,7 @@ function SanityCheckBuildPath ($path=0) $toTest = ('CMakeFiles', 'docs', 'etc', 'examples', 'include', 'managementgen', 'src') foreach ($pattern in $toTest) { - $target = Join-Path $path $pattern + $target = Join-Path $path $pattern if (!(Test-Path -path $target)) { $result = $false } @@ -313,7 +321,7 @@ function WriteDotnetBindingEnvSetupBat $out = @("@ECHO OFF REM -REM Call this command procedure from a command prompt to set up a $vsPlatform ($nBits-bit) +REM Call this command procedure from a command prompt to set up a $vsPlatform ($nBits-bit) REM $slnName environment REM REM > call $outfileName @@ -329,6 +337,56 @@ ECHO Environment set for $slnName $vsPlatform $nBits-bit development. $out | Out-File "$buildRoot\$outfileName" -encoding ASCII } +############################# +# Return the SelectedItem from the dropdown list and close the form. +# +function Return-DropDown { + if ($DropDown.SelectedItem -ne $null) { + $global:cmakeGenerator = $DropDown.SelectedItem.ToString() + $Form.Close() + Write-Host "Selected generator: $global:cmakeGenerator" + } +} + +############################# +# Create the CMake generator form and launch it +# +function SelectCMakeGenerator { + + $Form = New-Object System.Windows.Forms.Form + + $Form.width = 350 + $Form.height = 150 + $Form.Text = ”Select CMake Generator” + + $DropDown = new-object System.Windows.Forms.ComboBox + $DropDown.Location = new-object System.Drawing.Size(120,10) + $DropDown.Size = new-object System.Drawing.Size(150,30) + + ForEach ($Item in $global:VsVersionCmakeChoiceList) { + $DropDown.Items.Add($Item) + } + $DropDown.SelectedIndex = 0 + + $Form.Controls.Add($DropDown) + + $DropDownLabel = new-object System.Windows.Forms.Label + $DropDownLabel.Location = new-object System.Drawing.Size(10,10) + $DropDownLabel.size = new-object System.Drawing.Size(100,20) + $DropDownLabel.Text = "CMake generators" + $Form.Controls.Add($DropDownLabel) + + $Button = new-object System.Windows.Forms.Button + $Button.Location = new-object System.Drawing.Size(120,50) + $Button.Size = new-object System.Drawing.Size(120,20) + $Button.Text = "Select a generator" + $Button.Add_Click({Return-DropDown}) + $form.Controls.Add($Button) + + $Form.Add_Shown({$Form.Activate()}) + $Form.ShowDialog() +} + ############################# # Main @@ -341,6 +399,12 @@ ECHO Environment set for $slnName $vsPlatform $nBits-bit development. [string] $cppDir = Resolve-Path (Join-Path $curDir "..\..\..") [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null +[System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") | Out-Null + +############################# +# User dialog to select a version of Visual Studio as CMake generator +# +SelectCMakeGenerator ############################# # User dialog to get optional 32-bit boost and build paths @@ -412,7 +476,7 @@ if ($make32) { $env:BOOST_ROOT = "$boost32" cd "$build32" Write-Host "Running 32-bit CMake in $build32 ..." - CMake -G "Visual Studio 9 2008" "-DCMAKE_INSTALL_PREFIX=install_x86" $cppDir + CMake -G "$global:cmakeGenerator" "-DCMAKE_INSTALL_PREFIX=install_x86" $cppDir } else { Write-Host "Skipped 32-bit CMake." } @@ -424,7 +488,7 @@ if ($make64) { $env:BOOST_ROOT = "$boost64" cd "$build64" Write-Host "Running 64-bit CMake in $build64" - CMake -G "Visual Studio 9 2008 Win64" "-DCMAKE_INSTALL_PREFIX=install_x64" $cppDir + CMake -G "$global:cmakeGenerator Win64" "-DCMAKE_INSTALL_PREFIX=install_x64" $cppDir } else { Write-Host "Skipped 64-bit CMake." } @@ -437,7 +501,7 @@ if ($make64) { if ($defined32) { Write-Host "Writing 32-bit scripts..." - + ########### # Powershell script to launch org.apache.qpid.messaging.sln # @@ -448,8 +512,8 @@ if ($defined32) { -vsPlatform "x86" ` -nBits "32" ` -outfileName "start-devenv-messaging-x86-32bit.ps1" - - + + ########### # Batch script (that you doubleclick) to launch powershell script # that launches org.apache.qpid.messaging.sln. @@ -482,7 +546,7 @@ if ($defined32) { if ($defined64) { Write-Host "Writing 64-bit scripts..." - + ########### # Powershell script to launch org.apache.qpid.messaging.sln # @@ -493,8 +557,8 @@ if ($defined64) { -vsPlatform "x64" ` -nBits "64" ` -outfileName "start-devenv-messaging-x64-64bit.ps1" - - + + ########### # Batch script (that you doubleclick) to launch powershell script # that launches org.apache.qpid.messaging.sln. diff --git a/cpp/bindings/qpid/dotnet/examples/csharp.direct.receiver/Properties/AssemblyInfo.cs b/cpp/bindings/qpid/dotnet/examples/csharp.direct.receiver/Properties/AssemblyInfo.cs index abe35cf053..6976be5d02 100644 --- a/cpp/bindings/qpid/dotnet/examples/csharp.direct.receiver/Properties/AssemblyInfo.cs +++ b/cpp/bindings/qpid/dotnet/examples/csharp.direct.receiver/Properties/AssemblyInfo.cs @@ -7,9 +7,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -23,7 +23,7 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("csharp.direct.receiver")] @@ -31,12 +31,12 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("csharp.direct.receiver")] -[assembly: AssemblyCopyright("Copyright © 2010")] +[assembly: AssemblyCopyright("Copyright 2011")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] @@ -46,11 +46,11 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // -// You can specify all the values or you can default the Build and Revision Numbers +// You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] diff --git a/cpp/bindings/qpid/dotnet/examples/csharp.direct.sender/Properties/AssemblyInfo.cs b/cpp/bindings/qpid/dotnet/examples/csharp.direct.sender/Properties/AssemblyInfo.cs index 18502a0666..12368def8e 100644 --- a/cpp/bindings/qpid/dotnet/examples/csharp.direct.sender/Properties/AssemblyInfo.cs +++ b/cpp/bindings/qpid/dotnet/examples/csharp.direct.sender/Properties/AssemblyInfo.cs @@ -7,9 +7,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -23,7 +23,7 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("csharp.direct.sender")] @@ -31,12 +31,12 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("csharp.direct.sender")] -[assembly: AssemblyCopyright("Copyright © 2010")] +[assembly: AssemblyCopyright("Copyright 2011")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] @@ -46,11 +46,11 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // -// You can specify all the values or you can default the Build and Revision Numbers +// You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] diff --git a/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.receiver/Properties/AssemblyInfo.cs b/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.receiver/Properties/AssemblyInfo.cs index a87f92ccdf..459130ec6c 100644 --- a/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.receiver/Properties/AssemblyInfo.cs +++ b/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.receiver/Properties/AssemblyInfo.cs @@ -20,7 +20,7 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("csharp.map.callback.receiver")] @@ -28,12 +28,12 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("csharp.map.callback.receiver")] -[assembly: AssemblyCopyright("Copyright © 2010")] +[assembly: AssemblyCopyright("Copyright 2011")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] @@ -43,11 +43,11 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // -// You can specify all the values or you can default the Build and Revision Numbers +// You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] diff --git a/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.sender/Properties/AssemblyInfo.cs b/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.sender/Properties/AssemblyInfo.cs index e633f76673..2be4011f19 100644 --- a/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.sender/Properties/AssemblyInfo.cs +++ b/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.sender/Properties/AssemblyInfo.cs @@ -28,7 +28,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("csharp.map.callback.sender")] -[assembly: AssemblyCopyright("Copyright © 2010")] +[assembly: AssemblyCopyright("Copyright 2010")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/cpp/bindings/qpid/dotnet/examples/csharp.map.receiver/Properties/AssemblyInfo.cs b/cpp/bindings/qpid/dotnet/examples/csharp.map.receiver/Properties/AssemblyInfo.cs index 694d6b9ce1..f11ce8c220 100644 --- a/cpp/bindings/qpid/dotnet/examples/csharp.map.receiver/Properties/AssemblyInfo.cs +++ b/cpp/bindings/qpid/dotnet/examples/csharp.map.receiver/Properties/AssemblyInfo.cs @@ -7,9 +7,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -23,7 +23,7 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("csharp.map.receiver")] @@ -31,12 +31,12 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("csharp.map.receiver")] -[assembly: AssemblyCopyright("Copyright © 2010")] +[assembly: AssemblyCopyright("Copyright 2011")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] @@ -46,11 +46,11 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // -// You can specify all the values or you can default the Build and Revision Numbers +// You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] diff --git a/cpp/bindings/qpid/dotnet/examples/csharp.map.sender/Properties/AssemblyInfo.cs b/cpp/bindings/qpid/dotnet/examples/csharp.map.sender/Properties/AssemblyInfo.cs index ea29ac2417..ee09057f18 100644 --- a/cpp/bindings/qpid/dotnet/examples/csharp.map.sender/Properties/AssemblyInfo.cs +++ b/cpp/bindings/qpid/dotnet/examples/csharp.map.sender/Properties/AssemblyInfo.cs @@ -7,9 +7,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -23,7 +23,7 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("csharp.map.sender")] @@ -31,12 +31,12 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("csharp.map.sender")] -[assembly: AssemblyCopyright("Copyright © 2010")] +[assembly: AssemblyCopyright("Copyright 2011")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] @@ -46,11 +46,11 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // -// You can specify all the values or you can default the Build and Revision Numbers +// You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] diff --git a/cpp/bindings/qpid/dotnet/examples/visualbasic.example.client/MyProject/AssemblyInfo.vb b/cpp/bindings/qpid/dotnet/examples/visualbasic.example.client/MyProject/AssemblyInfo.vb index d0727fe9fa..469d6ed5cf 100644 --- a/cpp/bindings/qpid/dotnet/examples/visualbasic.example.client/MyProject/AssemblyInfo.vb +++ b/cpp/bindings/qpid/dotnet/examples/visualbasic.example.client/MyProject/AssemblyInfo.vb @@ -6,9 +6,9 @@ ' to you under the Apache License, Version 2.0 (the ' "License"); you may not use this file except in compliance ' with the License. You may obtain a copy of the License at -' +' ' http://www.apache.org/licenses/LICENSE-2.0 -' +' ' Unless required by applicable law or agreed to in writing, ' software distributed under the License is distributed on an ' "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -21,34 +21,34 @@ Imports System Imports System.Reflection Imports System.Runtime.InteropServices -' General Information about an assembly is controlled through the following +' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes - - - - - - + + + + + + 'The following GUID is for the ID of the typelib if this project is exposed to COM - + ' Version information for an assembly consists of the following four values: ' ' Major Version -' Minor Version +' Minor Version ' Build Number ' Revision ' -' You can specify all the values or you can default the Build and Revision Numbers +' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: -' +' - - + + diff --git a/cpp/bindings/qpid/dotnet/org.apache.qpid.messaging.sessionreceiver.sln b/cpp/bindings/qpid/dotnet/org.apache.qpid.messaging.sessionreceiver.sln index 90e98a4bbe..edf8af4808 100644 --- a/cpp/bindings/qpid/dotnet/org.apache.qpid.messaging.sessionreceiver.sln +++ b/cpp/bindings/qpid/dotnet/org.apache.qpid.messaging.sessionreceiver.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 -# +# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information @@ -8,9 +8,9 @@ Microsoft Visual Studio Solution File, Format Version 10.00 # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY diff --git a/cpp/bindings/qpid/dotnet/src/Address.cpp b/cpp/bindings/qpid/dotnet/src/Address.cpp index b688d973ed..79a8021d9a 100644 --- a/cpp/bindings/qpid/dotnet/src/Address.cpp +++ b/cpp/bindings/qpid/dotnet/src/Address.cpp @@ -141,7 +141,7 @@ namespace Messaging { } } - // copy constructor + // Copy constructor look-alike (C#) Address::Address(const Address ^ address) { System::Exception ^ newException = nullptr; @@ -163,6 +163,28 @@ namespace Messaging { } } + // Copy constructor implicitly dereferenced (C++) + Address::Address(const Address % address) + { + System::Exception ^ newException = nullptr; + + try + { + addressp = new ::qpid::messaging::Address( + *(const_cast
(address).NativeAddress)); + } + catch (const ::qpid::types::Exception & error) + { + String ^ errmsg = gcnew String(error.what()); + newException = gcnew QpidException(errmsg); + } + + if (newException != nullptr) + { + throw newException; + } + } + // unmanaged clone Address::Address(const ::qpid::messaging::Address & addrp) { diff --git a/cpp/bindings/qpid/dotnet/src/Address.h b/cpp/bindings/qpid/dotnet/src/Address.h index e5a00d8f11..8bbc207d4e 100644 --- a/cpp/bindings/qpid/dotnet/src/Address.h +++ b/cpp/bindings/qpid/dotnet/src/Address.h @@ -64,6 +64,7 @@ namespace Messaging { // copy constructor Address(const Address ^ address); + Address(const Address % address); // unmanaged clone Address(const ::qpid::messaging::Address & addrp); 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).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() diff --git a/cpp/bindings/qpid/dotnet/src/Connection.h b/cpp/bindings/qpid/dotnet/src/Connection.h index f9b62d4a08..0788f5d225 100644 --- a/cpp/bindings/qpid/dotnet/src/Connection.h +++ b/cpp/bindings/qpid/dotnet/src/Connection.h @@ -56,6 +56,7 @@ namespace Messaging { // copy constructor Connection(const Connection ^ connection); + Connection(const Connection % connection); // unmanaged clone // not defined diff --git a/cpp/bindings/qpid/dotnet/src/Duration.h b/cpp/bindings/qpid/dotnet/src/Duration.h index 213c338a59..d4239fae88 100644 --- a/cpp/bindings/qpid/dotnet/src/Duration.h +++ b/cpp/bindings/qpid/dotnet/src/Duration.h @@ -81,7 +81,17 @@ namespace Messaging { Duration ^ result = gcnew Duration(multiplier * dur->Milliseconds); return result; } - }; + + static bool operator == (Duration ^ a, Duration ^ b) + { + return a->Milliseconds == b->Milliseconds; + } + + static bool operator != (Duration ^ a, Duration ^ b) + { + return a->Milliseconds != b->Milliseconds; + } +}; public ref class DurationConstants sealed { diff --git a/cpp/bindings/qpid/dotnet/src/FailoverUpdates.h b/cpp/bindings/qpid/dotnet/src/FailoverUpdates.h index 1dd92b8688..d82e276fc8 100644 --- a/cpp/bindings/qpid/dotnet/src/FailoverUpdates.h +++ b/cpp/bindings/qpid/dotnet/src/FailoverUpdates.h @@ -54,6 +54,7 @@ namespace Messaging { // copy constructor FailoverUpdates(const FailoverUpdates ^ failoverUpdates) {} + FailoverUpdates(const FailoverUpdates % failoverUpdates) {} // assignment operator FailoverUpdates % operator=(const FailoverUpdates % rhs) 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).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; diff --git a/cpp/bindings/qpid/dotnet/src/Message.h b/cpp/bindings/qpid/dotnet/src/Message.h index b92cc4200b..ac7f285fe5 100644 --- a/cpp/bindings/qpid/dotnet/src/Message.h +++ b/cpp/bindings/qpid/dotnet/src/Message.h @@ -71,6 +71,7 @@ namespace Messaging { // Copy constructor Message(const Message ^ message); + Message(const Message % message); // unmanaged clone Message(const ::qpid::messaging::Message & msgp); diff --git a/cpp/bindings/qpid/dotnet/src/Receiver.cpp b/cpp/bindings/qpid/dotnet/src/Receiver.cpp index 3c0d79b393..8aa77effbd 100644 --- a/cpp/bindings/qpid/dotnet/src/Receiver.cpp +++ b/cpp/bindings/qpid/dotnet/src/Receiver.cpp @@ -89,7 +89,7 @@ namespace Messaging { } - // Copy constructor + // Copy constructor look-alike (C#) Receiver::Receiver(const Receiver ^ receiver) : parentSession(receiver->parentSession) { @@ -112,6 +112,29 @@ namespace Messaging { } } + // Copy constructor implicitly dereferenced (C++) + Receiver::Receiver(const Receiver % receiver) : + parentSession(receiver.parentSession) + { + System::Exception ^ newException = nullptr; + + try + { + receiverp = new ::qpid::messaging::Receiver( + *(const_cast(receiver).NativeReceiver)); + } + catch (const ::qpid::types::Exception & error) + { + String ^ errmsg = gcnew String(error.what()); + newException = gcnew QpidException(errmsg); + } + + if (newException != nullptr) + { + throw newException; + } + } + // // Get(message) diff --git a/cpp/bindings/qpid/dotnet/src/Receiver.h b/cpp/bindings/qpid/dotnet/src/Receiver.h index e9912a61dd..8ddcc9ac01 100644 --- a/cpp/bindings/qpid/dotnet/src/Receiver.h +++ b/cpp/bindings/qpid/dotnet/src/Receiver.h @@ -65,6 +65,7 @@ namespace Messaging { // copy constructor Receiver(const Receiver ^ receiver); + Receiver(const Receiver % receiver); // unmanaged clone // undefined diff --git a/cpp/bindings/qpid/dotnet/src/Sender.cpp b/cpp/bindings/qpid/dotnet/src/Sender.cpp index 584075ef5f..3225f1a6e1 100644 --- a/cpp/bindings/qpid/dotnet/src/Sender.cpp +++ b/cpp/bindings/qpid/dotnet/src/Sender.cpp @@ -84,7 +84,7 @@ namespace Messaging { } - // Copy constructor + // Copy constructor look-alike (C#) Sender::Sender(const Sender ^ sender) : parentSession(sender->parentSession) { @@ -107,6 +107,29 @@ namespace Messaging { } } + // Copy constructor implicitly dereferenced (C++) + Sender::Sender(const Sender % sender) + : parentSession(sender.parentSession) + { + System::Exception ^ newException = nullptr; + + try + { + senderp = new ::qpid::messaging::Sender( + *(const_cast(sender).NativeSender)); + } + catch (const ::qpid::types::Exception & error) + { + String ^ errmsg = gcnew String(error.what()); + newException = gcnew QpidException(errmsg); + } + + if (newException != nullptr) + { + throw newException; + } + } + // // Send(msg) diff --git a/cpp/bindings/qpid/dotnet/src/Sender.h b/cpp/bindings/qpid/dotnet/src/Sender.h index 0e90a9f4a4..4054e87316 100644 --- a/cpp/bindings/qpid/dotnet/src/Sender.h +++ b/cpp/bindings/qpid/dotnet/src/Sender.h @@ -62,6 +62,7 @@ namespace Messaging { // copy constructor Sender(const Sender ^ sender); + Sender(const Sender % sender); ~Sender(); !Sender(); diff --git a/cpp/bindings/qpid/dotnet/src/Session.cpp b/cpp/bindings/qpid/dotnet/src/Session.cpp index 880331c588..0e918769a3 100644 --- a/cpp/bindings/qpid/dotnet/src/Session.cpp +++ b/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).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() { @@ -224,6 +248,31 @@ namespace Messaging { } } + void Session::AcknowledgeUpTo(Message ^ message) + { + AcknowledgeUpTo(message, false); + } + + void Session::AcknowledgeUpTo(Message ^ message, bool sync) + { + System::Exception ^ newException = nullptr; + + try + { + sessionp->acknowledgeUpTo(*(message->NativeMessage), sync); + } + catch (const ::qpid::types::Exception & error) + { + String ^ errmsg = gcnew String(error.what()); + newException = gcnew QpidException(errmsg); + } + + if (newException != nullptr) + { + throw newException; + } + } + void Session::Reject(Message ^ message) { System::Exception ^ newException = nullptr; diff --git a/cpp/bindings/qpid/dotnet/src/Session.h b/cpp/bindings/qpid/dotnet/src/Session.h index 7eaad8a0a5..4b98a37f18 100644 --- a/cpp/bindings/qpid/dotnet/src/Session.h +++ b/cpp/bindings/qpid/dotnet/src/Session.h @@ -69,6 +69,7 @@ namespace Messaging { // copy constructor Session(const Session ^ session); + Session(const Session % session); ~Session(); !Session(); @@ -103,6 +104,8 @@ namespace Messaging { void Acknowledge(bool sync); void Acknowledge(Message ^ message); void Acknowledge(Message ^ message, bool sync); + void AcknowledgeUpTo(Message ^ message); + void AcknowledgeUpTo(Message ^ message, bool sync); void Reject(Message ^); void Release(Message ^); void Sync(); diff --git a/cpp/bindings/qpid/dotnet/test/messaging.test/Properties/AssemblyInfo.cs b/cpp/bindings/qpid/dotnet/test/messaging.test/Properties/AssemblyInfo.cs index cf50e88200..81a89ce393 100644 --- a/cpp/bindings/qpid/dotnet/test/messaging.test/Properties/AssemblyInfo.cs +++ b/cpp/bindings/qpid/dotnet/test/messaging.test/Properties/AssemblyInfo.cs @@ -7,9 +7,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -23,7 +23,7 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("messaging.test")] @@ -31,12 +31,12 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("messaging.test")] -[assembly: AssemblyCopyright("Copyright © 2010")] +[assembly: AssemblyCopyright("Copyright 2011")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] @@ -46,11 +46,11 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // -// You can specify all the values or you can default the Build and Revision Numbers +// You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] -- cgit v1.2.1