Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

dummy_namespace_to_avoid_gcc411_bug_ModelComponent_C::PtrChecker Struct Reference

Collaboration diagram for dummy_namespace_to_avoid_gcc411_bug_ModelComponent_C::PtrChecker:

Collaboration graph
[legend]
List of all members.

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.

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


The documentation for this struct was generated from the following file:
Generated on Mon Nov 23 15:56:56 2009 for iLab Neuromorphic Vision Toolkit by  doxygen 1.4.4