diff options
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 |