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

.. oe:namespace:: OEBioisostere

.. meta::
   :keywords: OEDBReader, DBReader


.. _OEBioisostere_OEDBReader:

.. oe:class:: OEDBReader

   .. attention::

      |PRELIMINARY-API|

   .. oe:api::

      class OEDBReader

   This class defines an interface for accessing a **Brood** fragment database
   from disk.

   The :ref:`OEDBReader <OEBioisostere_OEDBReader>` class defines the following public methods:
    * :oe:meth:`GetFragCount<OEBioisostere::OEDBReader::GetFragCount>`
    * :oe:meth:`GetIndices<OEBioisostere::OEDBReader::GetIndices>`
    * :oe:meth:`GetNextPacket<OEBioisostere::OEDBReader::GetNextPacket>`
    * :oe:meth:`Init<OEBioisostere::OEDBReader::Init>`

   

   .. _OEBioisostere_OEDBReader_Constructors:
   .. oe:method:: Constructors

      .. oe:language:: c++ java csharp

         .. oe:api::

            OEDBReader()

      .. oe:language:: python

         .. oe:api:: python

            OEDBReader() -> OEDBReader

      Default constructor.


   .. _OEBioisostere_OEDBReader_GetFragCount:
   .. oe:method:: GetFragCount

      .. oe:language:: c++ java csharp

         .. oe:api::

            unsigned GetFragCount() const

      .. oe:language:: python

         .. oe:api:: python

            GetFragCount() -> int

      Returns the number of fragments in the database currently associated with
      this reader.


   .. _OEBioisostere_OEDBReader_GetIndices:
   .. oe:method:: GetIndices

      .. oe:language:: c++ java csharp

         .. oe:api::

            const std::vector<unsigned>& GetIndices() const

      .. oe:language:: python

         .. oe:api:: python

            GetIndices() -> OEUIntVector

      Returns the database indices currently associated with this reader.


   .. _OEBioisostere_OEDBReader_GetNextPacket:
   .. oe:method:: GetNextPacket

      .. oe:language:: c++ java csharp

         .. oe:api::

            bool GetNextPacket(OEBroodDBPacket&)

      .. oe:language:: python

         .. oe:api:: python

            GetNextPacket(blob: OEBroodDBPacket) -> bool

      Retrieves the next available database packet.

   .. _OEBioisostere_OEDBReader_Init:   

   .. oe:method:: Init

      .. oe:language:: c++ java csharp

         .. oe:api::

            unsigned Init(const std::string& prefix, OEBroodQuery& query,
                          const OEBroodGeneralOptions& generalOpts = OEBroodGeneralOptions())
            unsigned Init(const std::string& prefix,
                          const std::vector<unsigned>& vecIdx = std::vector<unsigned>());

      .. oe:language:: python

         .. oe:api:: python

            Init(prefix: str, query: OEBroodQuery,
                 scoreOpts: OEBroodGeneralOptions = OEBroodGeneralOptions()) -> int
            Init(prefix: str, vecIdx: OEUIntVector = List[int]) -> int

      Initializes the reader using the database specified by ``prefix``.
      The first overload configures loading for packets from the specified
      database indices. The second overload determines relevant indices from
      the provided ``query`` and general options, then configures loading for
      those packets.
      Returns :oe:const:`OEBioisostere::OEBroodStatusCode::Success` if
      initialization is successful, otherwise an error code from
      :oe:constns:`OEBioisostere::OEBroodStatusCode`.

