2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
7 * Reserved. This file contains Original Code and/or Modifications of
8 * Original Code as defined in and that are subject to the Apple Public
9 * Source License Version 1.1 (the "License"). You may not use this file
10 * except in compliance with the License. Please obtain a copy of the
11 * License at http://www.apple.com/publicsource and read it before using
14 * The Original Code and all software distributed under the License are
15 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
19 * License for the specific language governing rights and limitations
22 * @APPLE_LICENSE_HEADER_END@
26 Copyright 1988-1996 NeXT Software, Inc.
28 DEFINED AS: A common class
29 HEADER FILES: <objc/Object.h>
33 #ifndef _OBJC_OBJECT_H_
34 #define _OBJC_OBJECT_H_
36 #include <objc/objc-runtime.h>
42 Class isa
; /* A pointer to the instance's class structure */
45 /* Initializing classes and instances */
50 /* Creating, copying, and freeing instances */
57 + allocFromZone
:(void *)zone
;
58 - copyFromZone
:(void *)zone
;
61 /* Identifying classes */
65 + (const char *) name
;
68 - (const char *) name
;
70 /* Identifying and comparing instances */
73 - (unsigned int) hash
;
74 - (BOOL
) isEqual
:anObject
;
76 /* Testing inheritance relationships */
78 - (BOOL
) isKindOf
: aClassObject
;
79 - (BOOL
) isMemberOf
: aClassObject
;
80 - (BOOL
) isKindOfClassNamed
: (const char *)aClassName
;
81 - (BOOL
) isMemberOfClassNamed
: (const char *)aClassName
;
83 /* Testing class functionality */
85 + (BOOL
) instancesRespondTo
:(SEL
)aSelector
;
86 - (BOOL
) respondsTo
:(SEL
)aSelector
;
88 /* Testing protocol conformance */
90 - (BOOL
) conformsTo
: (Protocol
*)aProtocolObject
;
91 + (BOOL
) conformsTo
: (Protocol
*)aProtocolObject
;
93 /* Obtaining method descriptors from protocols */
95 - (struct objc_method_description
*) descriptionForMethod
:(SEL
)aSel
;
96 + (struct objc_method_description
*) descriptionForInstanceMethod
:(SEL
)aSel
;
98 /* Obtaining method handles */
100 - (IMP
) methodFor
:(SEL
)aSelector
;
101 + (IMP
) instanceMethodFor
:(SEL
)aSelector
;
103 /* Sending messages determined at run time */
105 - perform
:(SEL
)aSelector
;
106 - perform
:(SEL
)aSelector with
:anObject
;
107 - perform
:(SEL
)aSelector with
:object1 with
:object2
;
111 + poseAs
: aClassObject
;
113 /* Enforcing intentions */
115 - subclassResponsibility
:(SEL
)aSelector
;
116 - notImplemented
:(SEL
)aSelector
;
120 - doesNotRecognize
:(SEL
)aSelector
;
121 - error
:(const char *)aString
, ...;
125 - (void) printForDebugger
:(void *)stream
;
130 - write
:(void *)stream
;
131 - read
:(void *)stream
;
133 + setVersion
: (int) aVersion
;
137 - forward
: (SEL
)sel
: (marg_list
)args
;
138 - performv
: (SEL
)sel
: (marg_list
)args
;
142 /* Abstract Protocol for Archiving */
144 @interface
Object (Archiving
)
146 - startArchiving
: (void *)stream
;
151 /* Abstract Protocol for Dynamic Loading */
153 #if !defined(NeXT_PDO)
154 @interface
Object (DynamicLoading
)
156 //+ finishLoading:(headerType *)header;
157 + finishLoading
:(struct mach_header
*)header
;
163 OBJC_EXPORT id
object_dispose(Object
*anObject
);
164 OBJC_EXPORT id
object_copy(Object
*anObject
, unsigned nBytes
);
165 OBJC_EXPORT id
object_copyFromZone(Object
*anObject
, unsigned nBytes
, void *z
);
166 OBJC_EXPORT id
object_realloc(Object
*anObject
, unsigned nBytes
);
167 OBJC_EXPORT id
object_reallocFromZone(Object
*anObject
, unsigned nBytes
, void *z
);
169 #endif /* _OBJC_OBJECT_H_ */