2 * Copyright (c) 1999-2003, 2005-2007 Apple Inc. All Rights Reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
25 Copyright 1988-1996 NeXT Software, Inc.
27 DEFINED AS: A common class
28 HEADER FILES: <objc/Object.h>
32 #ifndef _OBJC_OBJECT_H_
33 #define _OBJC_OBJECT_H_
36 #import <objc/objc-runtime.h>
40 __OSX_AVAILABLE_STARTING(__MAC_10_0
, __IPHONE_NA
)
43 Class isa
; /* A pointer to the instance's class structure */
47 -(BOOL
) isEqual
:anObject
;
53 __OSX_AVAILABLE_STARTING(__MAC_10_0
, __IPHONE_NA
)
56 Class isa
; /* A pointer to the instance's class structure */
59 /* Initializing classes and instances */
64 /* Creating, copying, and freeing instances */
71 + allocFromZone
:(void *)zone
;
72 - copyFromZone
:(void *)zone
;
75 /* Identifying classes */
79 + (const char *) name
;
82 - (const char *) name
;
84 /* Identifying and comparing instances */
87 - (unsigned int) hash
;
88 - (BOOL
) isEqual
:anObject
;
90 /* Testing inheritance relationships */
92 - (BOOL
) isKindOf
: aClassObject
;
93 - (BOOL
) isMemberOf
: aClassObject
;
94 - (BOOL
) isKindOfClassNamed
: (const char *)aClassName
;
95 - (BOOL
) isMemberOfClassNamed
: (const char *)aClassName
;
97 /* Testing class functionality */
99 + (BOOL
) instancesRespondTo
:(SEL
)aSelector
;
100 - (BOOL
) respondsTo
:(SEL
)aSelector
;
102 /* Testing protocol conformance */
104 - (BOOL
) conformsTo
: (Protocol
*)aProtocolObject
;
105 + (BOOL
) conformsTo
: (Protocol
*)aProtocolObject
;
107 /* Obtaining method descriptors from protocols */
109 - (struct objc_method_description
*) descriptionForMethod
:(SEL
)aSel
;
110 + (struct objc_method_description
*) descriptionForInstanceMethod
:(SEL
)aSel
;
112 /* Obtaining method handles */
114 - (IMP
) methodFor
:(SEL
)aSelector
;
115 + (IMP
) instanceMethodFor
:(SEL
)aSelector
;
117 /* Sending messages determined at run time */
119 - perform
:(SEL
)aSelector
;
120 - perform
:(SEL
)aSelector with
:anObject
;
121 - perform
:(SEL
)aSelector with
:object1 with
:object2
;
125 + poseAs
: aClassObject
;
127 /* Enforcing intentions */
129 - subclassResponsibility
:(SEL
)aSelector
;
130 - notImplemented
:(SEL
)aSelector
;
134 - doesNotRecognize
:(SEL
)aSelector
;
135 - error
:(const char *)aString
, ...;
139 - (void) printForDebugger
:(void *)stream
;
144 - write
:(void *)stream
;
145 - read
:(void *)stream
;
147 + setVersion
: (int) aVersion
;
151 - forward
: (SEL
)sel
: (marg_list
)args
;
152 - performv
: (SEL
)sel
: (marg_list
)args
;
156 /* Abstract Protocol for Archiving */
158 @interface
Object (Archiving
)
160 - startArchiving
: (void *)stream
;
165 /* Abstract Protocol for Dynamic Loading */
167 @interface
Object (DynamicLoading
)
169 //+ finishLoading:(headerType *)header;
170 + finishLoading
:(struct mach_header
*)header
;
177 #endif /* _OBJC_OBJECT_H_ */