diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2006-03-20 14:02:01 +0000 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2006-03-20 14:02:01 +0000 |
commit | 06ad21c2f678b3a34cc103b3083be9d96647e76d (patch) | |
tree | 46033285739df45469f86a0678e5081988dc0829 /cpp/src/Ice/OutgoingAsync.cpp | |
parent | Catch exceptions from destroySession (diff) | |
download | ice-06ad21c2f678b3a34cc103b3083be9d96647e76d.tar.bz2 ice-06ad21c2f678b3a34cc103b3083be9d96647e76d.tar.xz ice-06ad21c2f678b3a34cc103b3083be9d96647e76d.zip |
Imrpoved support for using array mapping in async responses and Blobject.
Diffstat (limited to 'cpp/src/Ice/OutgoingAsync.cpp')
-rw-r--r-- | cpp/src/Ice/OutgoingAsync.cpp | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/cpp/src/Ice/OutgoingAsync.cpp b/cpp/src/Ice/OutgoingAsync.cpp index 784cc6ca356..024c1f13764 100644 --- a/cpp/src/Ice/OutgoingAsync.cpp +++ b/cpp/src/Ice/OutgoingAsync.cpp @@ -31,6 +31,9 @@ void IceInternal::decRef(OutgoingAsync* p) { p->__decRef(); } void IceInternal::incRef(AMI_Object_ice_invoke* p) { p->__incRef(); } void IceInternal::decRef(AMI_Object_ice_invoke* p) { p->__decRef(); } +void IceInternal::incRef(AMI_Array_Object_ice_invoke* p) { p->__incRef(); } +void IceInternal::decRef(AMI_Array_Object_ice_invoke* p) { p->__decRef(); } + IceInternal::OutgoingAsync::OutgoingAsync() : __is(0), __os(0) @@ -417,12 +420,12 @@ IceInternal::OutgoingAsync::cleanup() void Ice::AMI_Object_ice_invoke::__invoke(const ObjectPrx& prx, const string& operation, OperationMode mode, - const pair<const Byte*, const Byte*>& inParams, const Context& context) + const vector<Byte>& inParams, const Context& context) { try { __prepare(prx, operation, mode, context); - __os->writeBlob(inParams.first, static_cast<Int>(inParams.second - inParams.first)); + __os->writeBlob(inParams); __os->endWriteEncaps(); } catch(const LocalException& ex) @@ -449,3 +452,39 @@ Ice::AMI_Object_ice_invoke::__response(bool ok) // ok == true means no user exce } ice_response(ok, outParams); } + +void +Ice::AMI_Array_Object_ice_invoke::__invoke(const ObjectPrx& prx, const string& operation, OperationMode mode, + const pair<const Byte*, const Byte*>& inParams, const Context& context) +{ + try + { + __prepare(prx, operation, mode, context); + __os->writeBlob(inParams.first, static_cast<Int>(inParams.second - inParams.first)); + __os->endWriteEncaps(); + } + catch(const LocalException& ex) + { + __finished(ex); + return; + } + __send(); +} + +void +Ice::AMI_Array_Object_ice_invoke::__response(bool ok) // ok == true means no user exception. +{ + pair<const Byte*, const Byte*> outParams; + try + { + Int sz = __is->getReadEncapsSize(); + __is->readBlob(outParams.first, sz); + outParams.second = outParams.first + sz; + } + catch(const LocalException& ex) + { + __finished(ex); + return; + } + ice_response(ok, outParams); +} |