IMP logo
IMP Reference Guide  2.6.1
The Integrative Modeling Platform
IMP::PointerMember< O > Struct Template Reference

A smart pointer to a ref-counted Object that is a class member. More...

#include <IMP/Pointer.h>

Inherits PointerBase< IMP::internal::PointerMemberTraits< O > >.

Detailed Description

template<class O>
struct IMP::PointerMember< O >

A smart pointer to a ref-counted Object that is a class member.

This class is identical to Pointer, but in addition, Object::set_was_used(true) will be called so you don't get warnings about unused objects once the object is stored in the owning class.

Note
The object being pointed to must inherit from IMP::Object.
Parameters
[in]OThe type of IMP::RefCounted-derived object to point to
See Also
Pointer
WeakPointer
UncheckedWeakPointer
Examples:
atom/dope_and_excluded_volume.cpp.

Definition at line 146 of file Pointer.h.

Public Types

typedef
IMP::internal::PointerBase
< IMP::internal::PointerMemberTraits
< O > > 
P
 

Public Member Functions

template<class Any >
 PointerMember (const Any &o)
 
O * get () const
 get the raw pointer to the object More...
 
template<class OT >
PointerMember< O > & operator= (const IMP::internal::PointerBase< OT > &o)
 
template<class OT >
PointerMember< O > & operator= (OT *o)
 
PointerMember< O > & operator= (const P &o)
 
O * release ()
 Relinquish control of the raw pointer stored in the PointerMember. More...
 

Member Function Documentation

template<class O>
O* IMP::PointerMember< O >::get ( ) const

get the raw pointer to the object

template<class O>
O* IMP::PointerMember< O >::release ( )

Relinquish control of the raw pointer stored in the PointerMember.

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 PointerMember

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