diff options
author | Mark Spruiell <mes@zeroc.com> | 2016-12-09 15:18:08 -0800 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2016-12-09 15:18:08 -0800 |
commit | 3b7e9f99b61538e0bbd6f07deeb7f7cb12013ed5 (patch) | |
tree | a8edbf5d1043527cc50880b34ee83458ed7e4855 /python/modules/IcePy/Operation.h | |
parent | Merge remote-tracking branch 'origin/3.6' (diff) | |
download | ice-3b7e9f99b61538e0bbd6f07deeb7f7cb12013ed5.tar.bz2 ice-3b7e9f99b61538e0bbd6f07deeb7f7cb12013ed5.tar.xz ice-3b7e9f99b61538e0bbd6f07deeb7f7cb12013ed5.zip |
ICE-7138 - new Python AMI mapping based on futures and modified AMD mapping
Diffstat (limited to 'python/modules/IcePy/Operation.h')
-rw-r--r-- | python/modules/IcePy/Operation.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/python/modules/IcePy/Operation.h b/python/modules/IcePy/Operation.h index cc8736f1ec7..3d0c2e44850 100644 --- a/python/modules/IcePy/Operation.h +++ b/python/modules/IcePy/Operation.h @@ -15,6 +15,8 @@ #include <Ice/Object.h> #include <Ice/AsyncResultF.h> #include <Ice/CommunicatorF.h> +#include <IceUtil/Monitor.h> +#include <Util.h> namespace IcePy { @@ -25,6 +27,7 @@ bool initOperation(PyObject*); // Builtin operations. // PyObject* invokeBuiltin(PyObject*, const std::string&, PyObject*); +PyObject* invokeBuiltinAsync(PyObject*, const std::string&, PyObject*); PyObject* beginBuiltin(PyObject*, const std::string&, PyObject*); PyObject* endBuiltin(PyObject*, const std::string&, PyObject*); @@ -63,6 +66,31 @@ protected: typedef IceUtil::Handle<GetConnectionCallback> GetConnectionCallbackPtr; // +// Used as the callback for getConnectionAsync operation. +// +class GetConnectionAsyncCallback : public IceUtil::Shared +{ +public: + + GetConnectionAsyncCallback(const Ice::CommunicatorPtr&, const std::string&); + ~GetConnectionAsyncCallback(); + + void setFuture(PyObject*); + + void response(const Ice::ConnectionPtr&); + void exception(const Ice::Exception&); + +protected: + + Ice::CommunicatorPtr _communicator; + std::string _op; + PyObject* _future; + Ice::ConnectionPtr _connection; + PyObject* _exception; +}; +typedef IceUtil::Handle<GetConnectionAsyncCallback> GetConnectionAsyncCallbackPtr; + +// // Used as the callback for the various flushBatchRequest operations. // class FlushCallback : public IceUtil::Shared @@ -84,6 +112,31 @@ protected: typedef IceUtil::Handle<FlushCallback> FlushCallbackPtr; // +// Used as the callback for the various flushBatchRequestAsync operations. +// +class FlushAsyncCallback : public IceUtil::Shared +{ +public: + + FlushAsyncCallback(const std::string&); + ~FlushAsyncCallback(); + + void setFuture(PyObject*); + + void exception(const Ice::Exception&); + void sent(bool); + +protected: + + std::string _op; + PyObject* _future; + bool _sent; + bool _sentSynchronously; + PyObject* _exception; +}; +typedef IceUtil::Handle<FlushAsyncCallback> FlushAsyncCallbackPtr; + +// // ServantWrapper handles dispatching to a Python servant. // class ServantWrapper : public Ice::BlobjectArrayAsync @@ -103,6 +156,9 @@ typedef IceUtil::Handle<ServantWrapper> ServantWrapperPtr; ServantWrapperPtr createServantWrapper(PyObject*); +PyObject* createFuture(); +PyObject* createFuture(const std::string&, PyObject*); + } #endif |