Object that holds a pointer to an ObjectBase (or derived) object. This class will register itself with the given ObjectBase object. When the registered ObjectBase object is destroyed, it will null the internal pointer. You can use this object to ensure you don't have dangling pointers to ObjectBase objects. More...
#include <objectbase.h>
Public Member Functions | |
| ObjectBasePtr (ObjectBase *object=nullptr) | |
| ObjectBasePtr (const ObjectBasePtr &object) | |
| Copy constructor. Tracks the same ObjectBase as the source. | |
| ~ObjectBasePtr () | |
| Destructor. Unlinks from the tracked ObjectBase. | |
| ObjectBasePtr & | operator= (const ObjectBasePtr &object) |
| Copy assignment operator. Re-links to the new ObjectBase. | |
| bool | isValid () const |
| Returns true if the tracked pointer is not null. | |
| ObjectBase * | data () |
| Returns a mutable pointer to the tracked ObjectBase. | |
| const ObjectBase * | data () const |
| Returns a const pointer to the tracked ObjectBase. | |
Friends | |
| class | ObjectBase |
Object that holds a pointer to an ObjectBase (or derived) object. This class will register itself with the given ObjectBase object. When the registered ObjectBase object is destroyed, it will null the internal pointer. You can use this object to ensure you don't have dangling pointers to ObjectBase objects.