summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2019-06-21 21:10:51 +0200
committerJose <jose@zeroc.com>2019-06-21 21:11:22 +0200
commit004138a45e1dc99c7a3ed61d6ee000b6638ae325 (patch)
treebfb9d6c9ae5f79b4fcf9ea7726bed0290497c473 /cpp
parentFixed incorrect comment for ice_flushBatchRequestsAsync. Fixes #379. (diff)
downloadice-004138a45e1dc99c7a3ed61d6ee000b6638ae325.tar.bz2
ice-004138a45e1dc99c7a3ed61d6ee000b6638ae325.tar.xz
ice-004138a45e1dc99c7a3ed61d6ee000b6638ae325.zip
Add ice_isFixed - Close #356
Diffstat (limited to 'cpp')
-rw-r--r--cpp/include/Ice/Proxy.h12
-rw-r--r--cpp/src/Ice/Proxy.cpp6
-rw-r--r--cpp/test/Ice/proxy/AllTests.cpp2
3 files changed, 20 insertions, 0 deletions
diff --git a/cpp/include/Ice/Proxy.h b/cpp/include/Ice/Proxy.h
index a486d004e84..a5bf67c494c 100644
--- a/cpp/include/Ice/Proxy.h
+++ b/cpp/include/Ice/Proxy.h
@@ -993,6 +993,12 @@ public:
::std::shared_ptr<::Ice::ObjectPrx> ice_fixed(const ::std::shared_ptr<::Ice::Connection>& connection) const;
/**
+ * Determines whether this proxy is a fixed proxy.
+ * @return True if this proxy is a fixed proxy, false otherwise.
+ */
+ bool ice_isFixed() const;
+
+ /**
* Obtains the Connection for this proxy. If the proxy does not yet have an established connection,
* it first attempts to create a connection.
* @return The connection for this proxy.
@@ -2659,6 +2665,12 @@ public:
::Ice::ObjectPrx ice_fixed(const ::Ice::ConnectionPtr& connection) const;
/**
+ * Determines whether this proxy is a fixed proxy.
+ * @return True if this proxy is a fixed proxy, false otherwise.
+ */
+ bool ice_isFixed() const;
+
+ /**
* Obtains the Connection for this proxy. If the proxy does not yet have an established connection,
* it first attempts to create a connection.
* @return The connection for this proxy.
diff --git a/cpp/src/Ice/Proxy.cpp b/cpp/src/Ice/Proxy.cpp
index f2b6e188ceb..76b03fa86ff 100644
--- a/cpp/src/Ice/Proxy.cpp
+++ b/cpp/src/Ice/Proxy.cpp
@@ -1287,6 +1287,12 @@ ICE_OBJECT_PRX::ice_fixed(const ::Ice::ConnectionPtr& connection) const
}
}
+bool
+ICE_OBJECT_PRX::ice_isFixed() const
+{
+ return FixedReferencePtr::dynamicCast(_reference);
+}
+
ConnectionPtr
ICE_OBJECT_PRX::ice_getCachedConnection() const
{
diff --git a/cpp/test/Ice/proxy/AllTests.cpp b/cpp/test/Ice/proxy/AllTests.cpp
index 147726defb0..a923bf398fb 100644
--- a/cpp/test/Ice/proxy/AllTests.cpp
+++ b/cpp/test/Ice/proxy/AllTests.cpp
@@ -1155,7 +1155,9 @@ allTests(Test::TestHelper* helper)
Ice::ConnectionPtr connection = cl->ice_getConnection();
if(connection)
{
+ test(!cl->ice_isFixed());
Test::MyClassPrxPtr prx = cl->ice_fixed(connection); // Test factory method return type
+ test(prx->ice_isFixed());
prx->ice_ping();
test(cl->ice_secure(true)->ice_fixed(connection)->ice_isSecure());
test(cl->ice_facet("facet")->ice_fixed(connection)->ice_getFacet() == "facet");