Table of Contents Previous Next
Logo
Client-Side Slice-to-Objective-C Mapping : 18.7 Mapping for Built-In Types
Copyright © 2003-2010 ZeroC, Inc.

18.7 Mapping for Built-In Types

The Slice built-in types are mapped to Objective‑C types as shown in Table 18.1.
NSString or NSMutableString
Slice bool maps to Objective‑C BOOL. The remaining integral and floating-point types map to Objective‑C type definitions instead of native types. This allows the Ice run time to provide a definition as appropriate for each target architecture. (For example, ICELong might be defined as long on one architecture and as long long on another.)
Note that ICEByte is a typedef for unsigned char. This guarantees that byte values are always in the range 0..255, and it ensures that right-shifting an ICEByte does not cause sign-extension.
Whether a Slice string maps to NSString or NSMutableString depends on the context. NSMutableString is used in some cases for operation parame­ters; otherwise, if a string is a data member of a Slice structure, class, or excep­tion, it maps to NSString. (We will discuss these differences in more detail as we cover the mapping of the relevant Slice language features.)

Table of Contents Previous Next
Logo