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>
42 Class isa
; /* A pointer to the instance's class structure */
46 -(BOOL
) isEqual
:anObject
;
54 Class isa
; /* A pointer to the instance's class structure */
57 /* Initializing classes and instances */
62 /* Creating, copying, and freeing instances */
69 + allocFromZone
:(void *)zone
;
70 - copyFromZone
:(void *)zone
;
73 /* Identifying classes */
77 + (const char *) name
;
80 - (const char *) name
;
82 /* Identifying and comparing instances */
85 - (unsigned int) hash
;
86 - (BOOL
) isEqual
:anObject
;
88 /* Testing inheritance relationships */
90 - (BOOL
) isKindOf
: aClassObject
;
91 - (BOOL
) isMemberOf
: aClassObject
;
92 - (BOOL
) isKindOfClassNamed
: (const char *)aClassName
;
93 - (BOOL
) isMemberOfClassNamed
: (const char *)aClassName
;
95 /* Testing class functionality */
97 + (BOOL
) instancesRespondTo
:(SEL
)aSelector
;
98 - (BOOL
) respondsTo
:(SEL
)aSelector
;
100 /* Testing protocol conformance */
102 - (BOOL
) conformsTo
: (Protocol
*)aProtocolObject
;
103 + (BOOL
) conformsTo
: (Protocol
*)aProtocolObject
;
105 /* Obtaining method descriptors from protocols */
107 - (struct objc_method_description
*) descriptionForMethod
:(SEL
)aSel
;
108 + (struct objc_method_description
*) descriptionForInstanceMethod
:(SEL
)aSel
;
110 /* Obtaining method handles */
112 - (IMP
) methodFor
:(SEL
)aSelector
;
113 + (IMP
) instanceMethodFor
:(SEL
)aSelector
;
115 /* Sending messages determined at run time */
117 - perform
:(SEL
)aSelector
;
118 - perform
:(SEL
)aSelector with
:anObject
;
119 - perform
:(SEL
)aSelector with
:object1 with
:object2
;
123 + poseAs
: aClassObject
;
125 /* Enforcing intentions */
127 - subclassResponsibility
:(SEL
)aSelector
;
128 - notImplemented
:(SEL
)aSelector
;
132 - doesNotRecognize
:(SEL
)aSelector
;
133 - error
:(const char *)aString
, ...;
137 - (void) printForDebugger
:(void *)stream
;
142 - write
:(void *)stream
;
143 - read
:(void *)stream
;
145 + setVersion
: (int) aVersion
;
149 - forward
: (SEL
)sel
: (marg_list
)args
;
150 - performv
: (SEL
)sel
: (marg_list
)args
;
154 /* Abstract Protocol for Archiving */
156 @interface
Object (Archiving
)
158 - startArchiving
: (void *)stream
;
163 /* Abstract Protocol for Dynamic Loading */
165 @interface
Object (DynamicLoading
)
167 //+ finishLoading:(headerType *)header;
168 + finishLoading
:(struct mach_header
*)header
;
175 #endif /* _OBJC_OBJECT_H_ */