00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __OBJECT_H
00025 #define __OBJECT_H
00026
00027 #if !defined(NOGC)
00028 # define GC_LINUX_THREADS
00029 # ifndef _REENTRANT
00030 # define _REENTRANT
00031 # endif
00032 # include <gc/gc_cpp.h>
00033 #endif
00034
00035 #define nil (0)
00036
00037 #define abstract = 0
00038
00042 #if defined __GNUC__ && defined __GNUC_MINOR__
00043 # define __GNUC_PREREQ(maj, min) \
00044 ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
00045 #else
00046 # define __GNUC_PREREQ(maj, min) 0
00047 #endif
00048
00055 namespace Core {
00056
00057 class Collection;
00058 class String;
00059 class Stream;
00060 class Visitor;
00061
00070 class Object
00071 #if !defined(NOGC)
00072 : public gc_cleanup
00073 #endif
00074 {
00075 protected:
00076 long oid;
00078 public:
00079 Object(void);
00080 virtual ~Object(void);
00081
00082
00089 virtual String *className(void) const;
00090
00091
00094 virtual void error(String *message, String *selector = nil,
00095 Object *parameter = nil);
00096
00103 virtual void shouldNotImplement(String *selector);
00104 virtual void shouldNotImplement(const char *selector);
00105
00106
00111 virtual long hash(void) const;
00119 virtual bool isEqual(const Object *object) const;
00124 virtual bool isEqual(const Object &object) const;
00125
00126 virtual bool isEqualToByteArray(const Object *array) const;
00127
00132 virtual bool operator==(const Object &object) const;
00133
00138 virtual bool isIdentical(const Object *object) const;
00143 virtual bool isIdentical(const Object &object) const;
00144
00145
00151 virtual void printOn(Stream *stream) const;
00154 virtual String *printString(void) const;
00155
00156
00158 virtual bool isAssociation(void) const;
00160 virtual bool isBoolean(void) const;
00162 virtual bool isCharacter(void) const;
00164 virtual bool isNumber(void) const;
00166 virtual bool isString(void) const;
00167
00171 virtual bool isInstanceOf(String *className);
00172
00177 virtual bool isInstanceOf(const char *className);
00178
00179
00180 virtual void visitBy(Visitor *visitor);
00181 };
00182
00183 };
00184
00185 using namespace Core;
00186
00187 #endif