… | |
… | |
140 | int ACC (RW, flags); |
140 | int ACC (RW, flags); |
141 | |
141 | |
142 | MTH void refcnt_inc () const { ++refcnt; } |
142 | MTH void refcnt_inc () const { ++refcnt; } |
143 | MTH void refcnt_dec () const { --refcnt; } |
143 | MTH void refcnt_dec () const { --refcnt; } |
144 | |
144 | |
|
|
145 | MTH int refcnt_cnt () const; |
145 | // check wether the object has died and destroy |
146 | // check wether the object has died and destroy |
146 | MTH void refcnt_chk () { if (refcnt <= 0) do_check (); } |
147 | MTH void refcnt_chk () { if (refcnt <= 0) do_check (); } |
147 | |
148 | |
148 | // destroy the object unless it was already destroyed |
149 | // destroy the object unless it was already destroyed |
149 | // this politely asks everybody interested the reduce |
150 | // this politely asks everybody interested the reduce |
… | |
… | |
180 | virtual ~attachable (); |
181 | virtual ~attachable (); |
181 | |
182 | |
182 | attachable &operator =(const attachable &src); |
183 | attachable &operator =(const attachable &src); |
183 | |
184 | |
184 | bool invoke (event_type event, ...); |
185 | bool invoke (event_type event, ...); |
185 | void instantiate (); |
186 | MTH void instantiate (); |
186 | void reattach (); |
187 | void reattach (); |
187 | |
188 | |
188 | protected: |
189 | protected: |
189 | // do the real refcount checking work |
190 | // do the real refcount checking work |
190 | void do_check (); |
191 | void do_check (); |