OEUnownedPtr

template<class T>
class OEUnownedPtr

Warning

This class has been deprecated. Use raw pointers instead. C++ only class. This class is not visible in any other languages.

This class is designed to provide the same “const correct-ness” guarantees that OEOwnedPtr provides. A description of this “const correct-ness” can be found in the OEOwnedPtr section. This class is really only useful to ensure pointer dereferencing does not inadvertently create a thread safety problem.

Constructors

OEUnownedPtr()
OEUnownedPtr(T *ptr)

Default constructors the pointer to NULL. Or constructor a smart pointer around the pointer ptr.

operator=

OEUnownedPtr<T> &operator=(T *rhs)

Construct a from the pointer ptr.

operator*

T &operator*()
const T &operator*() const

Dereference the object and return a reference to the held object while maintaining const correctness. Note, dereference a NULL pointer is undefined.

operator->

T *operator->()
const T *operator->() const

Access the pointer held by this object while maintaining const correctness.

operator T *

operator T *()

Implicit conversion to a pointer to T. Note, the implicit conversion does not break const correctness.

operator const T *

operator const T *() const

Implicit conversion to a pointer to const T. Note, the implicit conversion does not break const correctness.

Get

T *Get()
const T *Get() const

Access the pointer held by this smart pointer while maintaining const correctness.

Release

T *Release()

Returns the pointer owned by this smart pointer. This object will cease to point to the object in question. The object will effectively become a NULL pointer.

Warning

No memory management is performed on the pointer with delete.