Object.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
00003  *
00004  * @APPLE_LICENSE_HEADER_START@
00005  * 
00006  * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
00007  * Reserved.  This file contains Original Code and/or Modifications of
00008  * Original Code as defined in and that are subject to the Apple Public
00009  * Source License Version 1.1 (the "License").  You may not use this file
00010  * except in compliance with the License.  Please obtain a copy of the
00011  * License at http://www.apple.com/publicsource and read it before using
00012  * this file.
00013  * 
00014  * The Original Code and all software distributed under the License are
00015  * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
00016  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
00017  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
00018  * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT.  Please see the
00019  * License for the specific language governing rights and limitations
00020  * under the License.
00021  * 
00022  * @APPLE_LICENSE_HEADER_END@
00023  */
00024 /*
00025     Object.h
00026     Copyright 1988-1996 NeXT Software, Inc.
00027   
00028     DEFINED AS: A common class
00029     HEADER FILES:   <objc/Object.h>
00030 
00031 */
00032 
00033 #ifndef _OBJC_OBJECT_H_
00034 #define _OBJC_OBJECT_H_
00035 
00036 #include <objc/objc-runtime.h>
00037 
00038 @class Protocol;
00039 
00040 @interface Object
00041 {
00042     Class isa;  /* A pointer to the instance's class structure */
00043 }
00044 
00045 /* Initializing classes and instances */
00046 
00047 + initialize;
00048 - init;
00049 
00050 /* Creating, copying, and freeing instances */
00051 
00052 + new;
00053 + free;
00054 - free;
00055 + alloc;
00056 - copy;
00057 + allocFromZone:(void *)zone;
00058 - copyFromZone:(void *)zone;
00059 - (void *)zone;
00060 
00061 /* Identifying classes */
00062 
00063 + class;
00064 + superclass;
00065 + (const char *) name;
00066 - class;
00067 - superclass;
00068 - (const char *) name;
00069 
00070 /* Identifying and comparing instances */
00071 
00072 - self;
00073 - (unsigned int) hash;
00074 - (BOOL) isEqual:anObject;
00075 
00076 /* Testing inheritance relationships */
00077 
00078 - (BOOL) isKindOf: aClassObject;
00079 - (BOOL) isMemberOf: aClassObject;
00080 - (BOOL) isKindOfClassNamed: (const char *)aClassName;
00081 - (BOOL) isMemberOfClassNamed: (const char *)aClassName;
00082 
00083 /* Testing class functionality */
00084 
00085 + (BOOL) instancesRespondTo:(SEL)aSelector;
00086 - (BOOL) respondsTo:(SEL)aSelector;
00087 
00088 /* Testing protocol conformance */
00089 
00090 - (BOOL) conformsTo: (Protocol *)aProtocolObject;
00091 + (BOOL) conformsTo: (Protocol *)aProtocolObject;
00092 
00093 /* Obtaining method descriptors from protocols */
00094 
00095 - (struct objc_method_description *) descriptionForMethod:(SEL)aSel;
00096 + (struct objc_method_description *) descriptionForInstanceMethod:(SEL)aSel;
00097 
00098 /* Obtaining method handles */
00099 
00100 - (IMP) methodFor:(SEL)aSelector;
00101 + (IMP) instanceMethodFor:(SEL)aSelector;
00102 
00103 /* Sending messages determined at run time */
00104 
00105 - perform:(SEL)aSelector;
00106 - perform:(SEL)aSelector with:anObject;
00107 - perform:(SEL)aSelector with:object1 with:object2;
00108 
00109 /* Posing */
00110 
00111 + poseAs: aClassObject;
00112 
00113 /* Enforcing intentions */
00114  
00115 - subclassResponsibility:(SEL)aSelector;
00116 - notImplemented:(SEL)aSelector;
00117 
00118 /* Error handling */
00119 
00120 - doesNotRecognize:(SEL)aSelector;
00121 - error:(const char *)aString, ...;
00122 
00123 /* Debugging */
00124 
00125 - (void) printForDebugger:(void *)stream;
00126 
00127 /* Archiving */
00128 
00129 - awake;
00130 - write:(void *)stream;
00131 - read:(void *)stream;
00132 + (int) version;
00133 + setVersion: (int) aVersion;
00134 
00135 /* Forwarding */
00136 
00137 - forward: (SEL)sel : (marg_list)args;
00138 - performv: (SEL)sel : (marg_list)args;
00139 
00140 @end
00141 
00142 /* Abstract Protocol for Archiving */
00143 
00144 @interface Object (Archiving)
00145 
00146 - startArchiving: (void *)stream;
00147 - finishUnarchiving;
00148 
00149 @end
00150 
00151 /* Abstract Protocol for Dynamic Loading */
00152 
00153 @interface Object (DynamicLoading)
00154 
00155 //+ finishLoading:(headerType *)header;
00156 + finishLoading:(struct mach_header *)header;
00157 + startUnloading;
00158 
00159 @end
00160 
00161 OBJC_EXPORT id object_dispose(Object *anObject);
00162 OBJC_EXPORT id object_copy(Object *anObject, unsigned nBytes);
00163 OBJC_EXPORT id object_copyFromZone(Object *anObject, unsigned nBytes, void *z);
00164 OBJC_EXPORT id object_realloc(Object *anObject, unsigned nBytes);
00165 OBJC_EXPORT id object_reallocFromZone(Object *anObject, unsigned nBytes, void *z);
00166 
00167 #endif /* _OBJC_OBJECT_H_ */

Generated on Tue Sep 19 21:18:25 2006 for Boomerang by  doxygen 1.4.6