summaryrefslogtreecommitdiff
path: root/python
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 /python
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 'python')
-rw-r--r--python/modules/IcePy/Proxy.cpp25
-rw-r--r--python/test/Ice/proxy/AllTests.py2
2 files changed, 27 insertions, 0 deletions
diff --git a/python/modules/IcePy/Proxy.cpp b/python/modules/IcePy/Proxy.cpp
index d1733d6d993..c558dd315e8 100644
--- a/python/modules/IcePy/Proxy.cpp
+++ b/python/modules/IcePy/Proxy.cpp
@@ -1866,6 +1866,29 @@ proxyIceFixed(ProxyObject* self, PyObject* args)
extern "C"
#endif
static PyObject*
+proxyIceIsFixed(ProxyObject* self, PyObject* /*args*/)
+{
+ assert(self->proxy);
+
+ PyObject* b;
+ try
+ {
+ b = (*self->proxy)->ice_isFixed() ? getTrue() : getFalse();
+ }
+ catch(const Ice::Exception& ex)
+ {
+ setPythonException(ex);
+ return 0;
+ }
+
+ Py_INCREF(b);
+ return b;
+}
+
+#ifdef WIN32
+extern "C"
+#endif
+static PyObject*
proxyIceGetConnection(ProxyObject* self, PyObject* /*args*/)
{
assert(self->proxy);
@@ -2763,6 +2786,8 @@ static PyMethodDef ProxyMethods[] =
PyDoc_STR(STRCAST("ice_connectionId(string) -> Ice.ObjectPrx")) },
{ STRCAST("ice_fixed"), reinterpret_cast<PyCFunction>(proxyIceFixed), METH_VARARGS,
PyDoc_STR(STRCAST("ice_fixed(Ice.Connection) -> Ice.ObjectPrx")) },
+ { STRCAST("ice_isFixed"), reinterpret_cast<PyCFunction>(proxyIceIsFixed), METH_NOARGS,
+ PyDoc_STR(STRCAST("ice_isFixed() -> bool")) },
{ STRCAST("ice_getConnection"), reinterpret_cast<PyCFunction>(proxyIceGetConnection), METH_NOARGS,
PyDoc_STR(STRCAST("ice_getConnection() -> Ice.Connection")) },
{ STRCAST("ice_getConnectionAsync"), reinterpret_cast<PyCFunction>(proxyIceGetConnectionAsync),
diff --git a/python/test/Ice/proxy/AllTests.py b/python/test/Ice/proxy/AllTests.py
index 7f4781b55d2..e5bc5b9339f 100644
--- a/python/test/Ice/proxy/AllTests.py
+++ b/python/test/Ice/proxy/AllTests.py
@@ -654,6 +654,8 @@ def allTests(helper, communicator, collocated):
sys.stdout.flush()
connection = cl.ice_getConnection()
if connection != None:
+ test(cl.ice_isFixed() == False)
+ test(cl.ice_fixed(connection).ice_isFixed())
cl.ice_fixed(connection).getContext()
test(cl.ice_secure(True).ice_fixed(connection).ice_isSecure())
test(cl.ice_facet("facet").ice_fixed(connection).ice_getFacet() == "facet")