#include <Pointers.h>
Note how the * operator returns a _reference_ to the stored pointer. This template is mainly used to clean up call site regions where the functions allocate memory and take a double pointer as an argument, which makes it impossible to use a std::auto_ptr.
Definition at line 17 of file Pointers.h.
Public Member Functions | |
ScopePtr () | |
ScopePtr (_Class *obj) | |
~ScopePtr () | |
_Class & | operator * () const |
_Class * | operator-> () const |
ScopePtr & | operator= (_Class *ptr) |
Assignment operator that ensures there is no currently assigned pointer before claiming the given one. | |
_Class *& | ptr () |
This construction basically allows you to pass the ptr_ to a double pointer taking function, cleaning up the syntax quite a bit. | |
ScopePtr & | operator= (const ScopePtr &) |
Not implemented on purpose. | |
Private Attributes | |
_Class * | ptr_ |
oasys::ScopePtr< _Class >::ScopePtr | ( | ) | [inline] |
Definition at line 19 of file Pointers.h.
oasys::ScopePtr< _Class >::ScopePtr | ( | _Class * | obj | ) | [inline] |
Definition at line 20 of file Pointers.h.
oasys::ScopePtr< _Class >::~ScopePtr | ( | ) | [inline] |
_Class& oasys::ScopePtr< _Class >::operator * | ( | ) | const [inline] |
_Class* oasys::ScopePtr< _Class >::operator-> | ( | ) | const [inline] |
ScopePtr& oasys::ScopePtr< _Class >::operator= | ( | _Class * | ptr | ) | [inline] |
Assignment operator that ensures there is no currently assigned pointer before claiming the given one.
Definition at line 30 of file Pointers.h.
References ASSERT, and oasys::ScopePtr< _Class >::ptr_.
_Class*& oasys::ScopePtr< _Class >::ptr | ( | ) | [inline] |
This construction basically allows you to pass the ptr_ to a double pointer taking function, cleaning up the syntax quite a bit.
Definition at line 41 of file Pointers.h.
References oasys::ScopePtr< _Class >::ptr_.
ScopePtr& oasys::ScopePtr< _Class >::operator= | ( | const ScopePtr< _Class > & | ) |
Not implemented on purpose.
Don't handle assignment to another ScopePtr
_Class* oasys::ScopePtr< _Class >::ptr_ [private] |
Definition at line 50 of file Pointers.h.
Referenced by oasys::ScopePtr< _Class >::operator *(), oasys::ScopePtr< _Class >::operator->(), oasys::ScopePtr< _Class >::operator=(), oasys::ScopePtr< _Class >::ptr(), and oasys::ScopePtr< _Class >::~ScopePtr().