… | |
… | |
123 | }; |
123 | }; |
124 | |
124 | |
125 | struct refcounted |
125 | struct refcounted |
126 | { |
126 | { |
127 | refcounted () : refcnt (0) { } |
127 | refcounted () : refcnt (0) { } |
128 | // virtual ~refcounted (); |
128 | virtual ~refcounted (); |
129 | void refcnt_inc () { ++refcnt; } |
129 | void refcnt_inc () { ++refcnt; } |
130 | void refcnt_dec () { --refcnt; } |
130 | void refcnt_dec () { --refcnt; } |
131 | bool dead () { return refcnt == 0; } |
131 | bool dead () { return refcnt == 0; } |
132 | mutable int refcnt; |
132 | mutable int refcnt; |
133 | #if 0 |
133 | #if 0 |
… | |
… | |
165 | T &operator * () const { return *p; } |
165 | T &operator * () const { return *p; } |
166 | T *operator ->() const { return p; } |
166 | T *operator ->() const { return p; } |
167 | |
167 | |
168 | operator T *() const { return p; } |
168 | operator T *() const { return p; } |
169 | }; |
169 | }; |
|
|
170 | |
|
|
171 | typedef refptr<player> player_ptr; |
|
|
172 | typedef refptr<object> object_ptr; |
|
|
173 | typedef refptr<archetype> arch_ptr; |
170 | |
174 | |
171 | struct str_hash |
175 | struct str_hash |
172 | { |
176 | { |
173 | std::size_t operator ()(const char *s) const |
177 | std::size_t operator ()(const char *s) const |
174 | { |
178 | { |