IMP  2.1.1
The Integrative Modeling Platform
IMP::base::OwnerPointer< O > Struct Template Reference

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...
 

Detailed Description

template<class O>
struct IMP::base::OwnerPointer< O >

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.

Parameters
[in]OThe type of IMP::RefCounted-derived object to point to
Deprecated:
As of IMP release 2.1. See the IMP Deprecation Policy for more information about deprecation in IMP. Use ObjectMember instead

Definition at line 204 of file base/Pointer.h.

Constructor & Destructor Documentation

template<class O >
template<class Any >
IMP::base::OwnerPointer< O >::OwnerPointer ( const Any &  o)
Deprecated:
As of IMP release 2.1. See the IMP Deprecation Policy for more information about deprecation in IMP. Use ObjectMember instead

Definition at line 208 of file base/Pointer.h.

template<class O >
IMP::base::OwnerPointer< O >::OwnerPointer ( )
Deprecated:
As of IMP release 2.1. See the IMP Deprecation Policy for more information about deprecation in IMP. Use ObjectMember instead

Definition at line 212 of file base/Pointer.h.

Member Function Documentation

template<class O >
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.

Returns
a valid raw pointer to the object stored in the OwnerPointer

The documentation for this struct was generated from the following file: