Client-Side Slice-to-Swift Mapping
The client-side Slice-to-Swift mapping defines how Slice data types are translated to Swift types, and how clients invoke operations, pass parameters, and handle errors. Much of the Swift mapping is intuitive. For example, Slice sequences map to Swift arrays so there is essentially nothing new you have to learn in order to use Slice sequences in Swift.
The Swift API to the Ice run time is fully thread-safe. Obviously, you must still synchronize access to data from different threads. For example, if you have two threads sharing a sequence, you cannot safely have one thread insert into the sequence while another thread is iterating over the sequence. However, you only need to concern yourself with concurrent access to your own data — the Ice run time itself is fully thread safe, and none of the Ice APIs require you to serialize your calls.
Much of what appears in this chapter is reference material. We suggest that you skim the material on the initial reading and refer back to specific sections as needed. However, we recommend that you read at least the mappings for exceptions, interfaces, and operations in detail because these sections cover how to call operations from a client, pass parameters, and handle exceptions.
The Ice
Module
All of the APIs for the Ice run time are defined in the Ice
module, to avoid clashes with definitions for other libraries or applications. Some of the contents of the Ice
module are generated from Slice definitions; other parts of the Ice
module provide special-purpose definitions that do not have a corresponding Slice definition. We will incrementally cover the contents of the Ice
module throughout this manual.
Topics
- Swift Mapping for Identifiers
- Swift Mapping for Modules
- Swift Mapping for Built-in Types
- Swift Mapping for Enumerations
- Swift Mapping for Structures
- Swift Mapping for Classes
- Swift Mapping for Sequences
- Swift Mapping for Dictionaries
- Swift Mapping for Constants
- Swift Mapping for Exceptions
- Swift Mapping for Interfaces
- Swift Mapping for Operations
- Asynchronous Method Invocation (AMI) in Swift
- slice2swift Command-Line Options
- Example of File System Client in Swift