2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
27 Copyright 1988-1996 NeXT Software, Inc.
29 DEFINED AS: A common class
30 HEADER FILES: <objc/Object.h>
34 #ifndef _OBJC_OBJECT_H_
35 #define _OBJC_OBJECT_H_
37 #include <objc/objc-runtime.h>
43 Class isa
; /* A pointer to the instance's class structure */
46 /* Initializing classes and instances */
51 /* Creating, copying, and freeing instances */
58 + allocFromZone
:(void *)zone
;
59 - copyFromZone
:(void *)zone
;
62 /* Identifying classes */
66 + (const char *) name
;
69 - (const char *) name
;
71 /* Identifying and comparing instances */
74 - (unsigned int) hash
;
75 - (BOOL
) isEqual
:anObject
;
77 /* Testing inheritance relationships */
79 - (BOOL
) isKindOf
: aClassObject
;
80 - (BOOL
) isMemberOf
: aClassObject
;
81 - (BOOL
) isKindOfClassNamed
: (const char *)aClassName
;
82 - (BOOL
) isMemberOfClassNamed
: (const char *)aClassName
;
84 /* Testing class functionality */
86 + (BOOL
) instancesRespondTo
:(SEL
)aSelector
;
87 - (BOOL
) respondsTo
:(SEL
)aSelector
;
89 /* Testing protocol conformance */
91 - (BOOL
) conformsTo
: (Protocol
*)aProtocolObject
;
92 + (BOOL
) conformsTo
: (Protocol
*)aProtocolObject
;
94 /* Obtaining method descriptors from protocols */
96 - (struct objc_method_description
*) descriptionForMethod
:(SEL
)aSel
;
97 + (struct objc_method_description
*) descriptionForInstanceMethod
:(SEL
)aSel
;
99 /* Obtaining method handles */
101 - (IMP
) methodFor
:(SEL
)aSelector
;
102 + (IMP
) instanceMethodFor
:(SEL
)aSelector
;
104 /* Sending messages determined at run time */
106 - perform
:(SEL
)aSelector
;
107 - perform
:(SEL
)aSelector with
:anObject
;
108 - perform
:(SEL
)aSelector with
:object1 with
:object2
;
112 + poseAs
: aClassObject
;
114 /* Enforcing intentions */
116 - subclassResponsibility
:(SEL
)aSelector
;
117 - notImplemented
:(SEL
)aSelector
;
121 - doesNotRecognize
:(SEL
)aSelector
;
122 - error
:(const char *)aString
, ...;
126 - (void) printForDebugger
:(void *)stream
;
131 - write
:(void *)stream
;
132 - read
:(void *)stream
;
134 + setVersion
: (int) aVersion
;
138 - forward
: (SEL
)sel
: (marg_list
)args
;
139 - performv
: (SEL
)sel
: (marg_list
)args
;
143 /* Abstract Protocol for Archiving */
145 @interface
Object (Archiving
)
147 - startArchiving
: (void *)stream
;
152 /* Abstract Protocol for Dynamic Loading */
154 @interface
Object (DynamicLoading
)
156 //+ finishLoading:(headerType *)header;
157 + finishLoading
:(struct mach_header
*)header
;
162 OBJC_EXPORT id
object_dispose(Object
*anObject
);
163 OBJC_EXPORT id
object_copy(Object
*anObject
, unsigned nBytes
);
164 OBJC_EXPORT id
object_copyFromZone(Object
*anObject
, unsigned nBytes
, void *z
);
165 OBJC_EXPORT id
object_realloc(Object
*anObject
, unsigned nBytes
);
166 OBJC_EXPORT id
object_reallocFromZone(Object
*anObject
, unsigned nBytes
, void *z
);
168 #endif /* _OBJC_OBJECT_H_ */