// // Copyright (c) ZeroC, Inc. All rights reserved. // #import "BlobjectFacade.h" #import "ObjectAdapter.h" #import "Convert.h" #import "Connection.h" void BlobjectFacade::ice_invokeAsync(std::pair inEncaps, std::function&)> response, std::function error, const Ice::Current& current) { ICEBlobjectResponse responseCallback = ^(bool ok, const void* outParams, long count) { const Ice::Byte* start = static_cast(outParams); response(ok, std::make_pair(start, start + static_cast(count))); }; ICEBlobjectException exceptionCallback = ^(ICERuntimeException* e) { error(convertException(e)); }; ICEObjectAdapter* adapter = [ICEObjectAdapter getHandle:current.adapter]; ICEConnection* con = [ICEConnection getHandle:current.con]; @autoreleasepool { [_facade facadeInvoke:adapter inEncapsBytes:const_cast(inEncaps.first) inEncapsCount:static_cast(inEncaps.second - inEncaps.first) con:con name:toNSString(current.id.name) category:toNSString(current.id.category) facet:toNSString(current.facet) operation:toNSString(current.operation) mode:static_cast(current.mode) context:toNSDictionary(current.ctx) requestId:current.requestId encodingMajor:current.encoding.major encodingMinor:current.encoding.minor response:responseCallback exception:exceptionCallback]; } }