Helper class to ensure that no one tries to do rutz::shared_ptr<ModelComponent>. More...
Public Types | |
typedef std::set< const void * > | ComponentSet |
Public Member Functions | |
void | addPtr (const void *p) |
bool | hasPtr (const void *p) const |
void | forgetPtr (const void *p) |
Public Attributes | |
ComponentSet | itsSet |
Helper class to ensure that no one tries to do rutz::shared_ptr<ModelComponent>.
Since ModelComponent derives from nub::object, its reference-count is handled internally and should be managed by nub::ref or nub::soft_ref smart pointers. Catastrophe would be the result if we ended up with both a nub::soft_ref and a rutz::shared_ptr to the same object. So, to avoid that, we use the following solution: rutz::shared_ptr offers to call a hook function everytime somebody tries to construct a rutz::shared_ptr, and we here install such a hook function that checks to see if we recognize the attempted rutz::shared_ptr address as a live ModelComponent object. If so, we issue an LFATAL().
Definition at line 99 of file ModelComponent.C.