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 __WATCHOS_UNAVAILABLE
45 Class isa
; /* A pointer to the instance's class structure */
48 /* Initializing classes and instances */
53 /* Creating, copying, and freeing instances */
60 + (id
)allocFromZone
:(void *)zone
;
61 - (id
)copyFromZone
:(void *)zone
;
64 /* Identifying classes */
68 + (const char *) name
;
71 - (const char *) name
;
73 /* Identifying and comparing instances */
76 - (unsigned int) hash
;
77 - (BOOL
) isEqual
:anObject
;
79 /* Testing inheritance relationships */
81 - (BOOL
) isKindOf
: aClassObject
;
82 - (BOOL
) isMemberOf
: aClassObject
;
83 - (BOOL
) isKindOfClassNamed
: (const char *)aClassName
;
84 - (BOOL
) isMemberOfClassNamed
: (const char *)aClassName
;
86 /* Testing class functionality */
88 + (BOOL
) instancesRespondTo
:(SEL
)aSelector
;
89 - (BOOL
) respondsTo
:(SEL
)aSelector
;
91 /* Testing protocol conformance */
93 - (BOOL
) conformsTo
: (Protocol
*)aProtocolObject
;
94 + (BOOL
) conformsTo
: (Protocol
*)aProtocolObject
;
96 /* Obtaining method descriptors from protocols */
98 - (struct objc_method_description
*) descriptionForMethod
:(SEL
)aSel
;
99 + (struct objc_method_description
*) descriptionForInstanceMethod
:(SEL
)aSel
;
101 /* Obtaining method handles */
103 - (IMP
) methodFor
:(SEL
)aSelector
;
104 + (IMP
) instanceMethodFor
:(SEL
)aSelector
;
106 /* Sending messages determined at run time */
108 - (id
)perform
:(SEL
)aSelector
;
109 - (id
)perform
:(SEL
)aSelector with
:anObject
;
110 - (id
)perform
:(SEL
)aSelector with
:object1 with
:object2
;
114 + (id
)poseAs
: aClassObject
;
116 /* Enforcing intentions */
118 - (id
)subclassResponsibility
:(SEL
)aSelector
;
119 - (id
)notImplemented
:(SEL
)aSelector
;
123 - (id
)doesNotRecognize
:(SEL
)aSelector
;
124 - (id
)error
:(const char *)aString
, ...;
128 - (void) printForDebugger
:(void *)stream
;
133 - (id
)write
:(void *)stream
;
134 - (id
)read
:(void *)stream
;
136 + (id
)setVersion
: (int) aVersion
;
140 - (id
)forward
: (SEL
)sel
: (marg_list
)args
;
141 - (id
)performv
: (SEL
)sel
: (marg_list
)args
;
145 /* Abstract Protocol for Archiving */
147 @interface
Object (Archiving
)
149 - (id
)startArchiving
: (void *)stream
;
150 - (id
)finishUnarchiving
;
154 /* Abstract Protocol for Dynamic Loading */
156 @interface
Object (DynamicLoading
)
158 //+ finishLoading:(headerType *)header;
160 + (id
)finishLoading
:(struct mach_header
*)header
;
161 + (id
)startUnloading
;
167 #endif /* _OBJC_OBJECT_H_ */