| Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
ReferenceCounter Class Reference#include <ReferenceCounter.h>
Inheritance diagram for ReferenceCounter: ![]() Detailed DescriptionPerforms simple reference counting, will delete the object when removing the last reference.Remember to call SetAutoDelete(false) if you instantiate a subclass on the stack instead of the heap -- don't want to try to free memory on the stack if/when last reference is removed! (The stack limits the allocation of the behavior to the current scope, so reference counting is moot.)
Definition at line 16 of file ReferenceCounter.h.
Constructor & Destructor Documentation
copy constructor - uses autodelete setting of rc, but references will still start at 0
Definition at line 21 of file ReferenceCounter.h.
destructor - will std::cout a warning if still has references
Definition at line 26 of file ReferenceCounter.h.
Member Function Documentation
adds one to references
Definition at line 32 of file ReferenceCounter.h. Referenced by StateNode::addNode(), BehaviorSwitchControlBase::BehaviorSwitchControlBase(), BehaviorBase::DoStart(), Transition::fire(), RandomTrans::fire(), BehaviorActivatorControl::init(), MicrophoneServer::MicrophoneServer(), ToggleControl::setRadioGroup(), SpeakerServer::SpeakerServer(), and BehaviorSwitchControl< B, Al >::startmine().
returns the number of references
Definition at line 48 of file ReferenceCounter.h.
assignment operator - does nothing because the reference count shouldn't be copied
Definition at line 23 of file ReferenceCounter.h. Referenced by BehaviorBase::operator=().
subtracts one from references AND DELETES the object IF ZERO (and RC_autodelete is set)
Definition at line 35 of file ReferenceCounter.h. Referenced by BehaviorSwitchControl< B, Al >::behaviorStopped(), BehaviorSwitchControl< B, Al >::BehaviorSwitchControl(), BehaviorBase::DoStop(), Transition::fire(), RandomTrans::fire(), ToggleControl::setRadioGroup(), BehaviorActivatorControl::~BehaviorActivatorControl(), BehaviorSwitchControl< B, Al >::~BehaviorSwitchControl(), and BehaviorSwitchControlBase::~BehaviorSwitchControlBase().
if true, next time a RemoveReference() causes references to hit 0, the object will delete itself
Definition at line 51 of file ReferenceCounter.h. Referenced by BehaviorBase::~BehaviorBase(), and FreeMemReportControl::~FreeMemReportControl().
Member Data Documentation
if false, prevents deletion when counter hits 0
Definition at line 60 of file ReferenceCounter.h. Referenced by GetAutoDelete(), RemoveReference(), and SetAutoDelete().
the current number of references
Definition at line 57 of file ReferenceCounter.h. Referenced by AddReference(), GetReferences(), RemoveReference(), MicrophoneServer::~MicrophoneServer(), ~ReferenceCounter(), and SpeakerServer::~SpeakerServer().
The documentation for this class was generated from the following file: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Tekkotsu v3.0 |
Generated Wed Oct 4 00:05:11 2006 by Doxygen 1.4.7 |