.. oe:namespace:: OESystem



.. meta::
   :keywords: OEUnownedPtr, UnownedPtr


.. _OESystem_OEUnownedPtr:

.. oe:class:: OEUnownedPtr

   .. oe:api::

      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 :ref:`OEOwnedPtr <OESystem_OEOwnedPtr>` provides. A
   description of this "const correct-ness" can be found in the
   :ref:`OEOwnedPtr <OESystem_OEOwnedPtr>` section. This class is really only
   useful to ensure pointer dereferencing does not inadvertently
   create a thread safety problem.

   .. oe:method:: Constructors

      .. oe:api::

         OEUnownedPtr()
         OEUnownedPtr(T* ptr)

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

   .. oe:method:: operator=
      :language: c++

      .. oe:api::

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

      Construct a from the pointer ``ptr``.

      Assignment operator.


   .. oe:method:: operator*
      :language: c++

      .. oe:api::

         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.

   .. oe:method:: operator->
      :language: c++

      .. oe:api::

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

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

   .. oe:method:: operator T *
      :language: c++

      .. oe:api::

         operator T *()

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

   .. oe:method:: operator const T *
      :language: c++

      .. oe:api::

         operator const T *() const

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

   .. oe:method:: Get

      .. oe:api::

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

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

   .. oe:method:: Release

      .. oe:api::

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