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 #include <objc/objc-runtime.h>
38 #if __OBJC__ && !__OBJC2__
41 __IOS_UNAVAILABLE __TVOS_UNAVAILABLE
42 __WATCHOS_UNAVAILABLE __BRIDGEOS_UNAVAILABLE
46 Class isa
; /* A pointer to the instance's class structure */
49 /* Initializing classes and instances */
54 /* Creating, copying, and freeing instances */
61 + (id
)allocFromZone
:(void *)zone
;
62 - (id
)copyFromZone
:(void *)zone
;
65 /* Identifying classes */
69 + (const char *) name
;
72 - (const char *) name
;
74 /* Identifying and comparing instances */
77 - (unsigned int) hash
;
78 - (BOOL
) isEqual
:anObject
;
80 /* Testing inheritance relationships */
82 - (BOOL
) isKindOf
: aClassObject
;
83 - (BOOL
) isMemberOf
: aClassObject
;
84 - (BOOL
) isKindOfClassNamed
: (const char *)aClassName
;
85 - (BOOL
) isMemberOfClassNamed
: (const char *)aClassName
;
87 /* Testing class functionality */
89 + (BOOL
) instancesRespondTo
:(SEL
)aSelector
;
90 - (BOOL
) respondsTo
:(SEL
)aSelector
;
92 /* Testing protocol conformance */
94 - (BOOL
) conformsTo
: (Protocol
*)aProtocolObject
;
95 + (BOOL
) conformsTo
: (Protocol
*)aProtocolObject
;
97 /* Obtaining method descriptors from protocols */
99 - (struct objc_method_description
*) descriptionForMethod
:(SEL
)aSel
;
100 + (struct objc_method_description
*) descriptionForInstanceMethod
:(SEL
)aSel
;
102 /* Obtaining method handles */
104 - (IMP
) methodFor
:(SEL
)aSelector
;
105 + (IMP
) instanceMethodFor
:(SEL
)aSelector
;
107 /* Sending messages determined at run time */
109 - (id
)perform
:(SEL
)aSelector
;
110 - (id
)perform
:(SEL
)aSelector with
:anObject
;
111 - (id
)perform
:(SEL
)aSelector with
:object1 with
:object2
;
115 + (id
)poseAs
: aClassObject
;
117 /* Enforcing intentions */
119 - (id
)subclassResponsibility
:(SEL
)aSelector
;
120 - (id
)notImplemented
:(SEL
)aSelector
;
124 - (id
)doesNotRecognize
:(SEL
)aSelector
;
125 - (id
)error
:(const char *)aString
, ...;
129 - (void) printForDebugger
:(void *)stream
;
134 - (id
)write
:(void *)stream
;
135 - (id
)read
:(void *)stream
;
137 + (id
)setVersion
: (int) aVersion
;
141 - (id
)forward
: (SEL
)sel
: (marg_list
)args
;
142 - (id
)performv
: (SEL
)sel
: (marg_list
)args
;
146 /* Abstract Protocol for Archiving */
148 @interface
Object (Archiving
)
150 - (id
)startArchiving
: (void *)stream
;
151 - (id
)finishUnarchiving
;
155 /* Abstract Protocol for Dynamic Loading */
157 @interface
Object (DynamicLoading
)
159 //+ finishLoading:(headerType *)header;
161 + (id
)finishLoading
:(struct mach_header
*)header
;
162 + (id
)startUnloading
;
168 #endif /* _OBJC_OBJECT_H_ */