.. include:: ../../toolkit-substitutions

.. oe:namespace:: OESystem

.. meta::
   :keywords: OEUnboundedBuffer, UnboundedBuffer

.. attention::

   |CPPONLY|


.. _OESystem_OEUnboundedBuffer:

.. oe:class:: OEUnboundedBuffer

   .. oe:api::


      template<class T>
      class OEUnboundedBuffer

   First-in-first-out (FIFO) queue that only allows for any number of items
   to be stored in the buffer, hence, "unbounded".  It is not
   inherently thread safe by itself. Use this in conjunction with a
   :ref:`OEProtectedBuffer <OESystem_OEProtectedBuffer>` to make a thread-safe queue.

   .. oe:method:: Constructors

      .. oe:api::

         OEUnboundedBuffer(oesize_t)

      The constructor argument is unused and reserved for future
      use. It is only there to comply with the
      :ref:`OEBoundedBuffer <OESystem_OEBoundedBuffer>` constructor interface.

   .. oe:method:: Empty

      .. oe:api::

         bool Empty() const

      Returns whether the queue contains any items.

   .. oe:method:: Full

      .. oe:api::

         bool Full() const

      Returns ``true`` if the queue contains ``maxsize`` items.

   .. oe:method:: Get

      .. oe:api::

         T Get()

      Pops the next item off of the queue.

   .. oe:method:: Peek

      .. oe:api::

         T Peek()

      Returns the item that will be returned by the next call to
      :oe:meth:`OESystem::OEBoundedBuffer::Get`, but does not remove
      it from the queue.

   .. oe:method:: Put

      .. oe:api::

         void Put(T obj)

      Pushes an item into the queue.

   .. oe:method:: Size

      .. oe:api::

         oesize_t Size() const

      Returns the current number of items in the queue.
