|
|
1.1 root 1: /* Declare the class Object for Objective C programs.
2: Copyright (C) 1992 Free Software Foundation, Inc.
3:
4: This file is part of GNU CC.
5:
6: GNU CC is free software; you can redistribute it and/or modify
7: it under the terms of the GNU General Public License as published by
8: the Free Software Foundation; either version 2, or (at your option)
9: any later version.
10:
11: GNU CC is distributed in the hope that it will be useful,
12: but WITHOUT ANY WARRANTY; without even the implied warranty of
13: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: GNU General Public License for more details.
15:
16: You should have received a copy of the GNU General Public License
17: along with GNU CC; see the file COPYING. If not, write to
18: the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
19:
20: /* As a special exception, if you link this library with files
21: compiled with GCC to produce an executable, this does not cause
22: the resulting executable to be covered by the GNU General Public License.
23: This exception does not however invalidate any other reasons why
24: the executable file might be covered by the GNU General Public License. */
25:
26: #ifndef __object_INCLUDE_GNU
27: #define __object_INCLUDE_GNU
28:
29: #include "objc.h"
30: #include "stdio.h"
31:
32:
33: /*
34: * All classes are derived from Object. As such this is the
35: * overhead tacked onto those objects.
36: */
37: @interface Object {
38: Class_t isa; /* A pointer to the instance's
39: class structure.
40:
41: This structure is the one
42: generated by the compiler
43: and located in the TEXT
44: segment. The run-time uses
45: its address as a key to
46: run-time information. */
47: }
48:
49: /* Creating, copying, and freeing instances */
50:
51: + new;
52: + free;
53: - free;
54: - copy;
55: - shallowCopy;
56: - deepCopy;
57:
58: /* Identifying classes */
59:
60: + ( Class_t )class;
61: + ( Class_t )superClass;
62: - ( Class_t )class;
63: - ( Class_t )superClass;
64: - ( const char* )name;
65:
66: /* Identifying and comparing instances */
67:
68: - self;
69: - ( unsigned int )hash;
70: - ( BOOL )isEqual:anObject;
71:
72: /* Testing inheritance relationships */
73:
74: - ( BOOL )isKindOf:( Class_t )aClassObject;
75: - ( BOOL )isMemberOf:( Class_t )aClassObject;
76: - ( BOOL )isKindOfGivenName:( const char* )aClassName;
77: - ( BOOL )isMemberOfGivenName:( const char* )aClassName;
78:
79: /* Testing class functionality */
80:
81: + ( BOOL )instancesRespondTo:( SEL )aSel;
82: - ( BOOL )respondsTo:( SEL )aSel;
83:
84: /* Sending messages determined at run time */
85:
86: - perform:( SEL )aSel;
87: - perform:( SEL )aSel with:aObject;
88:
89: /* Posing */
90:
91: + poseAs:( Class_t )aClassObject;
92:
93: /* Enforcing intentions */
94:
95: - subclassResponsibility:( SEL )aSel;
96: - notImplemented:( SEL )aSel;
97:
98: /* Error handling */
99:
100: - doesNotRecognize:(SEL)aSelector;
101: - error:( const char* )aString, ...;
102: + error:( const char* )aString, ...;
103:
104: /* Archiving */
105:
106: - storeOn:( int )aFd;
107: + readFrom:( int )aFd;
108: - readFrom:( int )aFd;
109: + ( int )version;
110: + setVersion:( int )aVersion;
111:
112: @end
113:
114:
115: #endif
116:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.