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__
40 __OSX_AVAILABLE_STARTING(__MAC_10_0
, __IPHONE_NA
)
44 Class isa
; /* A pointer to the instance's class structure */
47 /* Initializing classes and instances */
52 /* Creating, copying, and freeing instances */
59 + (id
)allocFromZone
:(void *)zone
;
60 - (id
)copyFromZone
:(void *)zone
;
63 /* Identifying classes */
67 + (const char *) name
;
70 - (const char *) name
;
72 /* Identifying and comparing instances */
75 - (unsigned int) hash
;
76 - (BOOL
) isEqual
:anObject
;
78 /* Testing inheritance relationships */
80 - (BOOL
) isKindOf
: aClassObject
;
81 - (BOOL
) isMemberOf
: aClassObject
;
82 - (BOOL
) isKindOfClassNamed
: (const char *)aClassName
;
83 - (BOOL
) isMemberOfClassNamed
: (const char *)aClassName
;
85 /* Testing class functionality */
87 + (BOOL
) instancesRespondTo
:(SEL
)aSelector
;
88 - (BOOL
) respondsTo
:(SEL
)aSelector
;
90 /* Testing protocol conformance */
92 - (BOOL
) conformsTo
: (Protocol
*)aProtocolObject
;
93 + (BOOL
) conformsTo
: (Protocol
*)aProtocolObject
;
95 /* Obtaining method descriptors from protocols */
97 - (struct objc_method_description
*) descriptionForMethod
:(SEL
)aSel
;
98 + (struct objc_method_description
*) descriptionForInstanceMethod
:(SEL
)aSel
;
100 /* Obtaining method handles */
102 - (IMP
) methodFor
:(SEL
)aSelector
;
103 + (IMP
) instanceMethodFor
:(SEL
)aSelector
;
105 /* Sending messages determined at run time */
107 - (id
)perform
:(SEL
)aSelector
;
108 - (id
)perform
:(SEL
)aSelector with
:anObject
;
109 - (id
)perform
:(SEL
)aSelector with
:object1 with
:object2
;
113 + (id
)poseAs
: aClassObject
;
115 /* Enforcing intentions */
117 - (id
)subclassResponsibility
:(SEL
)aSelector
;
118 - (id
)notImplemented
:(SEL
)aSelector
;
122 - (id
)doesNotRecognize
:(SEL
)aSelector
;
123 - (id
)error
:(const char *)aString
, ...;
127 - (void) printForDebugger
:(void *)stream
;
132 - (id
)write
:(void *)stream
;
133 - (id
)read
:(void *)stream
;
135 + (id
)setVersion
: (int) aVersion
;
139 - (id
)forward
: (SEL
)sel
: (marg_list
)args
;
140 - (id
)performv
: (SEL
)sel
: (marg_list
)args
;
144 /* Abstract Protocol for Archiving */
146 @interface
Object (Archiving
)
148 - (id
)startArchiving
: (void *)stream
;
149 - (id
)finishUnarchiving
;
153 /* Abstract Protocol for Dynamic Loading */
155 @interface
Object (DynamicLoading
)
157 //+ finishLoading:(headerType *)header;
159 + (id
)finishLoading
:(struct mach_header
*)header
;
160 + (id
)startUnloading
;
166 #endif /* _OBJC_OBJECT_H_ */