diff options
author | Matthew Newhook <matthew@zeroc.com> | 2015-03-21 15:35:40 -0230 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2015-03-21 15:35:40 -0230 |
commit | 630a37d2fe66f24518299e705f958b571803c522 (patch) | |
tree | 969723791bdc4d73bb099c19d45554d0ca241ad9 /python/modules/IcePy/Operation.h | |
parent | Fix some README.md markdown formatting (diff) | |
download | ice-630a37d2fe66f24518299e705f958b571803c522.tar.bz2 ice-630a37d2fe66f24518299e705f958b571803c522.tar.xz ice-630a37d2fe66f24518299e705f958b571803c522.zip |
py -> python
rb -> ruby
objc -> objective-c
cs -> csharp
Diffstat (limited to 'python/modules/IcePy/Operation.h')
-rw-r--r-- | python/modules/IcePy/Operation.h | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/python/modules/IcePy/Operation.h b/python/modules/IcePy/Operation.h new file mode 100644 index 00000000000..cf10184b9cb --- /dev/null +++ b/python/modules/IcePy/Operation.h @@ -0,0 +1,108 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +#ifndef ICEPY_OPERATION_H +#define ICEPY_OPERATION_H + +#include <Config.h> +#include <Ice/Current.h> +#include <Ice/Object.h> +#include <Ice/AsyncResultF.h> +#include <Ice/CommunicatorF.h> + +namespace IcePy +{ + +bool initOperation(PyObject*); + +// +// Builtin operations. +// +PyObject* invokeBuiltin(PyObject*, const std::string&, PyObject*); +PyObject* beginBuiltin(PyObject*, const std::string&, PyObject*); +PyObject* endBuiltin(PyObject*, const std::string&, PyObject*); + +// +// Blobject invocations. +// +PyObject* iceInvoke(PyObject*, PyObject*); +PyObject* iceInvokeAsync(PyObject*, PyObject*); +PyObject* beginIceInvoke(PyObject*, PyObject*, PyObject*); +PyObject* endIceInvoke(PyObject*, PyObject*); + +extern PyTypeObject AsyncResultType; +PyObject* createAsyncResult(const Ice::AsyncResultPtr&, PyObject*, PyObject*, PyObject*); +Ice::AsyncResultPtr getAsyncResult(PyObject*); + +// +// Used as the callback for getConnection operation. +// +class GetConnectionCallback : public IceUtil::Shared +{ +public: + + GetConnectionCallback(const Ice::CommunicatorPtr&, PyObject*, PyObject*, const std::string&); + ~GetConnectionCallback(); + + void response(const Ice::ConnectionPtr&); + void exception(const Ice::Exception&); + +protected: + + Ice::CommunicatorPtr _communicator; + PyObject* _response; + PyObject* _ex; + std::string _op; +}; +typedef IceUtil::Handle<GetConnectionCallback> GetConnectionCallbackPtr; + +// +// Used as the callback for the various flushBatchRequest operations. +// +class FlushCallback : public IceUtil::Shared +{ +public: + + FlushCallback(PyObject*, PyObject*, const std::string&); + ~FlushCallback(); + + void exception(const Ice::Exception&); + void sent(bool); + +protected: + + PyObject* _ex; + PyObject* _sent; + std::string _op; +}; +typedef IceUtil::Handle<FlushCallback> FlushCallbackPtr; + +// +// ServantWrapper handles dispatching to a Python servant. +// +class ServantWrapper : public Ice::BlobjectArrayAsync +{ +public: + + ServantWrapper(PyObject*); + ~ServantWrapper(); + + PyObject* getObject(); + +protected: + + PyObject* _servant; +}; +typedef IceUtil::Handle<ServantWrapper> ServantWrapperPtr; + +ServantWrapperPtr createServantWrapper(PyObject*); + +} + +#endif |