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

.. oe:namespace:: OEConfGen

.. meta::
   :keywords: OEBuilderBase, BuilderBase


.. _OEConfGen_OEBuilderBase:

.. oe:class:: OEBuilderBase

   .. oe:api::

      class OEBuilderBase

   This is an abstract base class for structure builder classes that use a
   fragment library. 

   The :ref:`OEBuilderBase <OEConfGen_OEBuilderBase>` class defines the following public methods:
    * :oe:meth:`AddFragLib<OEConfGen::OEBuilderBase::AddFragLib>`
    * :oe:meth:`ClearFragLibs<OEConfGen::OEBuilderBase::ClearFragLibs>`

   The following classes derive from this class:
    * :ref:`OEMakeFragLib <OEConfGen_OEMakeFragLib>`
    * :ref:`OEMolBuilder <OEConfGen_OEMolBuilder>`

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

      .. oe:api::

         OEBuilderBase & operator=(const OEBuilderBase & rhs)

      Assignment operator.


   .. oe:method:: AddFragLib

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

         .. oe:api::

            bool AddFragLib()
            bool AddFragLib(const std::string &)
            bool AddFragLib(OEPlatform::oeistream &)

      .. oe:language:: python

         .. oe:api:: python

            AddFragLib() -> bool
            AddFragLib(arg2: str) -> bool
            AddFragLib(arg2: oeistream) -> bool

      Adds a **fragment library** to be used for pregenerated
      fragment coordinates.
      When the :oe:meth:`OEConfGen::OEBuilderBase::AddFragLib` is called
      without a parameter, the *built-in* fragment library is loaded immediately.
      By default, the *built-in* fragment library does not load until it is
      required in use for the first time.

      The ``string`` and :ref:`oeistream <OEPlatform_oeistream>` versions of
      :oe:meth:`OEConfGen::OEBuilderBase::AddFragLib` can be
      used to add external fragments libraries.
      These external libraries are used in addition to the built-in one.
      Returns *true* if the fragment library is added successfully.

      .. seealso::

         * :oe:meth:`OEConfGen::OEBuilderBase::ClearFragLibs` method

   .. _OEConfGen_ClearFragLibs:

   .. oe:method:: ClearFragLibs

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

         .. oe:api::

            void ClearFragLibs()

      .. oe:language:: python

         .. oe:api:: python

            ClearFragLibs() -> None

      Clears all fragment libraries from the builder.

      .. seealso::

         * :oe:meth:`OEConfGen::OEBuilderBase::AddFragLib` method
