Object-Oriented Design

Grand Central Dispatch is an object-oriented library, even though it is implemented purely in C. The fundamental GCD types are pointers to opaque data structures, but there is an inheritance model involved. The base class for dispatch objects is dispatch_object_t. You never directly create one of these; instead, you create concrete objects such as queues, sources, or groups. There are a couple of types, such as dispatch_once_t and dispatch_time_t. These are not objects but semi-opaque scalar types, as shown in Figure 22.5

Figure 22.5  Dispatch classes and functions

Dispatch classes and functions

Get Advanced Mac OS X Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.