Fix change log
[official-gcc.git] / libobjc / objc / Object.h
blobe5c32f1447f4f83bfe5552fb07c3e9fafc8a208b
1 /* Interface for the Object class for Objective-C.
2 Copyright (C) 1993, 1994, 1995, 2009, 2010 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the
8 Free Software Foundation; either version 3, or (at your option) any
9 later version.
11 GCC is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
14 License for more details.
16 Under Section 7 of GPL version 3, you are granted additional
17 permissions described in the GCC Runtime Library Exception, version
18 3.1, as published by the Free Software Foundation.
20 You should have received a copy of the GNU General Public License and
21 a copy of the GCC Runtime Library Exception along with this program;
22 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23 <http://www.gnu.org/licenses/>. */
26 #ifndef __object_INCLUDE_GNU
27 #define __object_INCLUDE_GNU
29 #include "objc.h"
30 #include "typedstream.h"
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
36 /* The Object class is a minimal (but fully functional) root class
37 included with the runtime.
39 It is mostly for testing the runtime; very handy in configure
40 tests, and when writing language/runtime testcases.
42 Because Objective-C allows multiple root classes, a Foundation
43 library (such as GNUstep Base) is expected to provide its own root
44 class (typically called NSObject), fully integrated with the
45 library's own high-level features. If you are using such a
46 Foundation library, you should most likely use its root class for
47 everything and ignore Object.
51 All classes are derived from Object. As such,
52 this is the overhead tacked onto those objects.
54 @interface Object
56 Class isa; /* A pointer to the instance's class structure */
59 /* Initializing classes and instances */
60 + initialize;
61 - init;
63 /* Creating, freeing, and copying instances */
64 + new;
65 + alloc;
66 - free;
67 - copy;
68 - shallowCopy;
69 - deepen;
70 - deepCopy;
72 /* Identifying classes */
73 - (Class)class;
74 - (Class)superClass;
75 - (MetaClass)metaClass;
76 - (const char *)name;
78 /* Identifying and comparing objects */
79 - self;
80 - (unsigned int)hash;
81 - (BOOL)isEqual:anObject;
82 - (int)compare:(id)anotherObject;
84 /* Testing object type */
85 - (BOOL)isMetaClass;
86 - (BOOL)isClass;
87 - (BOOL)isInstance;
89 /* Testing inheritance relationships */
90 - (BOOL)isKindOf:(Class)aClassObject;
91 - (BOOL)isMemberOf:(Class)aClassObject;
92 - (BOOL)isKindOfClassNamed:(const char *)aClassName;
93 - (BOOL)isMemberOfClassNamed:(const char *)aClassName;
95 /* Testing class functionality */
96 + (BOOL)instancesRespondTo:(SEL)aSel;
97 - (BOOL)respondsTo:(SEL)aSel;
99 /* Testing protocol conformance */
100 - (BOOL)conformsTo:(Protocol*)aProtocol;
102 /* Introspection */
103 + (IMP)instanceMethodFor:(SEL)aSel;
104 - (IMP)methodFor:(SEL)aSel;
105 + (struct objc_method_description *)descriptionForInstanceMethod:(SEL)aSel;
106 - (struct objc_method_description *)descriptionForMethod:(SEL)aSel;
108 /* Sending messages determined at run time */
109 - perform:(SEL)aSel;
110 - perform:(SEL)aSel with:anObject;
111 - perform:(SEL)aSel with:anObject1 with:anObject2;
113 /* Forwarding */
114 - (retval_t)forward:(SEL)aSel :(arglist_t)argFrame;
115 - (retval_t)performv:(SEL)aSel :(arglist_t)argFrame;
117 /* Posing */
118 + poseAs:(Class)aClassObject;
119 - (Class)transmuteClassTo:(Class)aClassObject;
121 /* Enforcing intentions */
122 - subclassResponsibility:(SEL)aSel;
123 - notImplemented:(SEL)aSel;
124 - shouldNotImplement:(SEL)aSel;
126 /* Error handling */
127 - doesNotRecognize:(SEL)aSel;
128 - error:(const char *)aString, ...;
130 /* Archiving */
131 + (int)version;
132 + setVersion:(int)aVersion;
133 @end
135 #include "deprecated/Object.h"
137 #ifdef __cplusplus
139 #endif
141 #endif