Type IDs and Generic Object References

Base Services define a couple of base types for Core Foundation objects. These types are intended for use in polymorphic functions and as general-purpose type identifiers.

Every Core Foundation opaque type defines a unique type ID for its objects. A type ID is an integer of type CFTypeID that identifies the opaque type to which a Core Foundation object "belongs." You use type IDs in various contexts, such as when you are operating on heterogeneous collections. Base Services provide programmatic interfaces for obtaining and evaluating type IDs.

Important
Because the value for a type ID can change from release to release, your code should not rely on stored or hard-coded type IDs nor should it hard-code any observed properties of a type ID (such as, for example, it being a small integer).

Base Services define a generic Core Foundation object-reference type, CFTypeRef . This generic reference serves as a placeholder type for parameters and returned values of polymorphic functions, which can take references to any Core Foundation object. See Polymorphic Functions for more on this subject.


© 1999 Apple Computer, Inc. – (Last Updated 07 September 99)