IMP
2.1.0
The Integrative Modeling Platform
|
A reference counted pointer to an Object. More...
#include <IMP/base/Pointer.h>
Inherits PointerBase< internal::PointerMemberTraits< O > >.
Public Types | |
typedef internal::PointerBase < internal::PointerMemberTraits < O > > | P |
Public Member Functions | |
template<class Any > | |
OwnerPointer (const Any &o) | |
OwnerPointer () | |
O * | get () const |
get the raw pointer to the object | |
template<class OT > | |
base::OwnerPointer< O > & | operator= (const internal::PointerBase< OT > &o) |
template<class OT > | |
base::OwnerPointer< O > & | operator= (OT *o) |
base::OwnerPointer< O > & | operator= (const P &o) |
O * | release () |
Relinquish control of the raw pointer stored in the OwnerPointer. More... | |
The object being pointed to must inherit from IMP::base::Object. In addition to reference counting the object like Pointer, Object::set_was_used(true) will be called so you don't get warnings about unused objects.
[in] | O | The type of IMP::RefCounted-derived object to point to |
Definition at line 202 of file base/Pointer.h.
Definition at line 206 of file base/Pointer.h.
IMP::base::OwnerPointer< O >::OwnerPointer | ( | ) |
Definition at line 210 of file base/Pointer.h.
O* IMP::base::OwnerPointer< O >::release | ( | ) |
Relinquish control of the raw pointer stored in the OwnerPointer. Use this to safely return objects allocated within functions. The reference count of the object will be decreased by one, but even it it becomes 0, the object will not be destroyed.