|
xorp
|
Base class for objects that are callback safe. More...
#include <safe_callback_obj.hh>
Public Member Functions | |
| void | ref_cb (SafeCallbackBase *scb) |
| void | unref_cb (SafeCallbackBase *scb) |
Protected Attributes | |
| vector< SafeCallbackBase * > | _cbs |
Base class for objects that are callback safe.
Objects that wish to be callback safe should be derived from this class. The class works in conjunction with SafeCallbackBase and between them implement callback and callback-object tracking. When a CallbackSafeObject is destructed it informs all the callbacks that refer to it that this is the case and invalidates (sets to null) the object they point to.
Copy operations are not supported. It's hard to know what the correct thing to do on assignment or copy, so best bet is not to do anything.