dummy_namespace_to_avoid_gcc411_bug_ModelComponent_C::PtrChecker Struct Reference

Helper class to ensure that no one tries to do rutz::shared_ptr<ModelComponent>. More...

Collaboration diagram for dummy_namespace_to_avoid_gcc411_bug_ModelComponent_C::PtrChecker:
Collaboration graph
[legend]

List of all members.

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

Detailed Description

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.


The documentation for this struct was generated from the following file:
Generated on Sun May 8 08:28:47 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3