33 #ifndef DART_COMMON_DETAIL_SUB_PTR_HPP_
34 #define DART_COMMON_DETAIL_SUB_PTR_HPP_
108 removeSubject(mSubjectBase);
109 mSubjectBase =
dynamic_cast<Subject*
>(_ptr);
111 addSubject(mSubjectBase);
118 return mT !=
nullptr;
125 if(_subject == mSubjectBase)
128 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:89
sub_ptr & operator=(const sub_ptr &_sp)
Change the Subject of this sub_ptr.
Definition: sub_ptr.hpp:59
void set(T *_ptr)
Set the subject of this sub_ptr.
Definition: sub_ptr.hpp:103
sub_ptr()
Default constructor.
Definition: sub_ptr.hpp:43
T * get() const
Get the Subject of this sub_ptr.
Definition: sub_ptr.hpp:96
void handleDestructionNotification(const Subject *_subject) override
Called by receiveDestructionNotification().
Definition: sub_ptr.hpp:123
T & operator*() const
Dereferencing operator.
Definition: sub_ptr.hpp:82
bool valid()
True if and only if this sub_ptr still points to a valid Subject.
Definition: sub_ptr.hpp:116
Definition: BulletCollisionDetector.cpp:63