diff options
author | Charles E. Rolke <chug@apache.org> | 2010-11-02 14:29:50 +0000 |
---|---|---|
committer | Charles E. Rolke <chug@apache.org> | 2010-11-02 14:29:50 +0000 |
commit | 975a123ca8fc1b2db6a6c27c6ebc8d654ad246fc (patch) | |
tree | c17704b34eaa1e98e91bfdcad1a64a2234c69ca6 | |
parent | 8a96f77d3446326911a1b78b5b01c5712ac3a058 (diff) | |
download | qpid-python-975a123ca8fc1b2db6a6c27c6ebc8d654ad246fc.tar.gz |
QPID-2922 Qpid Cpp Messaging .NET Binding does not implement FailoverUpdate class
This checkin provides the implemtation.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1030061 13f79535-47bb-0310-9956-ffa450edef68
3 files changed, 169 insertions, 0 deletions
diff --git a/qpid/cpp/bindings/qpid/dotnet/src/FailoverUpdates.cpp b/qpid/cpp/bindings/qpid/dotnet/src/FailoverUpdates.cpp new file mode 100644 index 0000000000..3df06d9557 --- /dev/null +++ b/qpid/cpp/bindings/qpid/dotnet/src/FailoverUpdates.cpp @@ -0,0 +1,94 @@ +/*
+* 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
+* regarding copyright ownership. The ASF licenses this file
+* 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
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+#include <windows.h>
+#include <msclr\lock.h>
+#include <oletx2xa.h>
+#include <string>
+#include <limits>
+
+#include "qpid/messaging/FailoverUpdates.h"
+
+#include "Connection.h"
+#include "FailoverUpdates.h"
+#include "QpidException.h"
+
+namespace Org {
+namespace Apache {
+namespace Qpid {
+namespace Messaging {
+
+ /// <summary>
+ /// FailoverUpdates is a managed wrapper for a qpid::messaging::FailoverUpdates
+ /// </summary>
+
+ // constructors
+ //FailoverUpdates::FailoverUpdates(Connection ^ connection) :
+ // failoverupdatesp(new ::qpid::messaging::FailoverUpdates(*(connection->NativeConnection)))
+ //{
+ //}
+
+ FailoverUpdates::FailoverUpdates(Connection ^ connection)
+ {
+ System::Exception ^ newException = nullptr;
+
+ try
+ {
+ failoverupdatesp = new ::qpid::messaging::FailoverUpdates(*(connection->NativeConnection));
+ }
+ catch (const ::qpid::types::Exception & error)
+ {
+ String ^ errmsg = gcnew String(error.what());
+ newException = gcnew QpidException(errmsg);
+ }
+
+ if (newException != nullptr)
+ {
+ throw newException;
+ }
+
+ return;
+ }
+
+
+ // Destructor
+ FailoverUpdates::~FailoverUpdates()
+ {
+ Cleanup();
+ }
+
+
+ // Finalizer
+ FailoverUpdates::!FailoverUpdates()
+ {
+ Cleanup();
+ }
+
+
+ // Destroys kept object
+ // TODO: add lock
+ void FailoverUpdates::Cleanup()
+ {
+ if (NULL != failoverupdatesp)
+ {
+ delete failoverupdatesp;
+ failoverupdatesp = NULL;
+ }
+ }
+}}}}
diff --git a/qpid/cpp/bindings/qpid/dotnet/src/FailoverUpdates.h b/qpid/cpp/bindings/qpid/dotnet/src/FailoverUpdates.h new file mode 100644 index 0000000000..bc668d616c --- /dev/null +++ b/qpid/cpp/bindings/qpid/dotnet/src/FailoverUpdates.h @@ -0,0 +1,67 @@ +/*
+* 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
+* regarding copyright ownership. The ASF licenses this file
+* 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
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+#pragma once
+
+#include <windows.h>
+#include <msclr\lock.h>
+#include <oletx2xa.h>
+#include <string>
+#include <limits>
+
+namespace Org {
+namespace Apache {
+namespace Qpid {
+namespace Messaging {
+
+ /// <summary>
+ /// FailoverUpdates is a managed wrapper for a qpid::messaging::FailoverUpdates
+ /// </summary>
+
+ ref class Connection;
+
+ public ref class FailoverUpdates
+ {
+ private:
+ // The kept object in the Messaging C++ DLL
+ ::qpid::messaging::FailoverUpdates * failoverupdatesp;
+
+ // Kept object deletion code
+ void Cleanup();
+
+ public:
+ FailoverUpdates(Connection ^ connection);
+
+ ~FailoverUpdates();
+ !FailoverUpdates();
+
+ private:
+ // unmanaged clone
+ // not defined
+
+ // copy constructor
+ FailoverUpdates(const FailoverUpdates ^ failoverUpdates) {}
+
+ // assignment operator
+ FailoverUpdates % operator=(const FailoverUpdates % rhs)
+ {
+ return *this;
+ }
+ };
+}}}}
diff --git a/qpid/cpp/bindings/qpid/dotnet/src/org.apache.qpid.messaging.vcproj b/qpid/cpp/bindings/qpid/dotnet/src/org.apache.qpid.messaging.vcproj index 1eb0b718de..286e4ad1c4 100644 --- a/qpid/cpp/bindings/qpid/dotnet/src/org.apache.qpid.messaging.vcproj +++ b/qpid/cpp/bindings/qpid/dotnet/src/org.apache.qpid.messaging.vcproj @@ -538,6 +538,10 @@ >
</File>
<File
+ RelativePath=".\FailoverUpdates.cpp"
+ >
+ </File>
+ <File
RelativePath=".\Message.cpp"
>
</File>
@@ -576,6 +580,10 @@ >
</File>
<File
+ RelativePath=".\FailoverUpdates.h"
+ >
+ </File>
+ <File
RelativePath=".\Message.h"
>
</File>
|