00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef _OBJECT_TABLE_H_
00036 #define _OBJECT_TABLE_H_
00037
00038 #include "../main/includes.h"
00039 #include "../list/listItem.h"
00040 #include "../allocator/allocator.h"
00041
00057 class ObjectTable: public LI1 {
00058 public:
00059
00061 jint id;
00062
00064 IdObject* obj;
00065
00066 public:
00067
00073 ObjectTable( jint i, IdObject* o) :
00074
00075 id( i),
00076 obj( o)
00077
00078 {}
00079
00081 virtual ~ObjectTable() {}
00082
00091 const jint& getKey( jint& key) { return key = id;}
00092
00102 int operator==( const jint& key) { return (id == key);}
00103
00110 static int hashKey( const jint& key) { return (int)key;}
00111
00112 #ifdef USE_ALLOCATOR
00113 private:
00114
00116 static Allocator _allocator;
00117
00118 public:
00119
00122 void* operator new( size_t sz) { return _allocator.get( sz);}
00123
00126 void operator delete( void* unit) { _allocator.put( unit);}
00127 #endif
00128 };
00129
00130 #endif // _OBJECT_TABLE_H_