Skip to content

Commit

Permalink
Reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardnormier committed Jun 5, 2024
1 parent be7b02b commit d005d46
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 37 deletions.
26 changes: 13 additions & 13 deletions swift/src/IceImpl/DispatchAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ typedef void (^ICEOutgoingResponse)(uint8_t, NSString* _Nullable, NSString* _Nul
// The implementation must call the completion handler exactly once.
ICEIMPL_API @protocol ICEDispatchAdapter
- (void)dispatch:(ICEObjectAdapter*)adapter
inEncapsBytes:(void*)inEncapsBytes
inEncapsCount:(long)inEncapsCount
con:(ICEConnection* _Nullable)con
name:(NSString*)name
category:(NSString*)category
facet:(NSString*)facet
operation:(NSString*)operation
mode:(uint8_t)mode
context:(NSDictionary<NSString*, NSString*>*)context
requestId:(int32_t)requestId
encodingMajor:(uint8_t)encodingMajor
encodingMinor:(uint8_t)encodingMinor
completionHandler:(ICEOutgoingResponse)completionHandler;
inEncapsBytes:(void*)inEncapsBytes
inEncapsCount:(long)inEncapsCount
con:(ICEConnection* _Nullable)con
name:(NSString*)name
category:(NSString*)category
facet:(NSString*)facet
operation:(NSString*)operation
mode:(uint8_t)mode
context:(NSDictionary<NSString*, NSString*>*)context
requestId:(int32_t)requestId
encodingMajor:(uint8_t)encodingMajor
encodingMinor:(uint8_t)encodingMinor
completionHandler:(ICEOutgoingResponse)completionHandler;

- (void)complete;
@end
Expand Down
46 changes: 23 additions & 23 deletions swift/src/IceImpl/DispatchAdapter.mm
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright (c) ZeroC, Inc.

#import "DispatchAdapter.h"
#import "Connection.h"
#import "Convert.h"
#import "DispatchAdapter.h"
#import "Exception.h"
#import "Ice/AsyncResponseHandler.h"
#import "ObjectAdapter.h"
Expand All @@ -15,16 +15,16 @@

ICEOutgoingResponse outgoingResponse =
^(uint8_t replyStatus, NSString* exceptionId, NSString* exceptionMessage, const void* message, long count) {
// We need to copy the message here as we don't own the memory and it can be sent asynchronously.
Ice::OutputStream ostr(current.adapter->getCommunicator());
ostr.writeBlob(static_cast<const std::byte*>(message), static_cast<size_t>(count));
// We need to copy the message here as we don't own the memory and it can be sent asynchronously.
Ice::OutputStream ostr(current.adapter->getCommunicator());
ostr.writeBlob(static_cast<const std::byte*>(message), static_cast<size_t>(count));

sendResponse(Ice::OutgoingResponse{
static_cast<Ice::ReplyStatus>(replyStatus),
fromNSString(exceptionId),
fromNSString(exceptionMessage),
std::move(ostr),
current});
sendResponse(Ice::OutgoingResponse{
static_cast<Ice::ReplyStatus>(replyStatus),
fromNSString(exceptionId),
fromNSString(exceptionMessage),
std::move(ostr),
current});
};

int32_t sz;
Expand All @@ -37,18 +37,18 @@
@autoreleasepool
{
[_dispatchAdapter dispatch:adapter
inEncapsBytes:const_cast<std::byte*>(inEncaps)
inEncapsCount:static_cast<long>(sz)
con:con
name:toNSString(current.id.name)
category:toNSString(current.id.category)
facet:toNSString(current.facet)
operation:toNSString(current.operation)
mode:static_cast<std::uint8_t>(current.mode)
context:toNSDictionary(current.ctx)
requestId:current.requestId
encodingMajor:current.encoding.major
encodingMinor:current.encoding.minor
completionHandler:outgoingResponse];
inEncapsBytes:const_cast<std::byte*>(inEncaps)
inEncapsCount:static_cast<long>(sz)
con:con
name:toNSString(current.id.name)
category:toNSString(current.id.category)
facet:toNSString(current.facet)
operation:toNSString(current.operation)
mode:static_cast<std::uint8_t>(current.mode)
context:toNSDictionary(current.ctx)
requestId:current.requestId
encodingMajor:current.encoding.major
encodingMinor:current.encoding.minor
completionHandler:outgoingResponse];
}
}
3 changes: 2 additions & 1 deletion swift/src/IceImpl/ObjectAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ ICEIMPL_API @interface ICEObjectAdapter : ICELocalObject

#ifdef __cplusplus

@interface ICEObjectAdapter ()
@interface
ICEObjectAdapter ()
@property(nonatomic, readonly) std::shared_ptr<Ice::ObjectAdapter> objectAdapter;
@end

Expand Down

0 comments on commit d005d46

Please sign in to comment.