33 #ifndef DART_COMMON_DETAIL_SUB_PTR_HPP_
34 #define DART_COMMON_DETAIL_SUB_PTR_HPP_
113 removeSubject(mSubjectBase);
114 mSubjectBase =
dynamic_cast<Subject*
>(_ptr);
116 addSubject(mSubjectBase);
123 return mT !=
nullptr;
130 if (_subject == mSubjectBase)
133 mSubjectBase =
nullptr;
The Subject class is a base class for any object that wants to report when it gets destroyed.
Definition: Subject.hpp:58
sub_ptr is a pointer to a Subject.
Definition: sub_ptr.hpp:47
T * operator->() const
Dereferencing operation.
Definition: sub_ptr.hpp:94
sub_ptr & operator=(const sub_ptr &_sp)
Change the Subject of this sub_ptr.
Definition: sub_ptr.hpp:64
void set(T *_ptr)
Set the subject of this sub_ptr.
Definition: sub_ptr.hpp:108
sub_ptr()
Default constructor.
Definition: sub_ptr.hpp:43
T * get() const
Get the Subject of this sub_ptr.
Definition: sub_ptr.hpp:101
void handleDestructionNotification(const Subject *_subject) override
Called by receiveDestructionNotification().
Definition: sub_ptr.hpp:128
T & operator*() const
Dereferencing operator.
Definition: sub_ptr.hpp:87
bool valid()
True if and only if this sub_ptr still points to a valid Subject.
Definition: sub_ptr.hpp:121
Definition: BulletCollisionDetector.cpp:65