.. include:: ../substitutions

.. oe:namespace:: OEChem

.. meta::
   :keywords: OENewQMolBase

.. oe:function:: OENewQMolBase

   .. oe:api::

      OEQMolBase* OENewQMolBase(unsigned int type = OEQMolType::OEDefault)
      OEQMolBase* OENewQMolBase(const OEMolBase& mol,
                                unsigned int type = OEQMolType::OEDefault)
      OEQMolBase* OENewQMolBase(const OEQMolBase& mol,
                                unsigned int type = OEQMolType::OEDefault)

   Allocates an implementation of an :ref:`OEQMolBase <OEChem_OEQMolBase>` based on
   the integer 'type' argument.  The 'type' argument specifies the
   implementation type to be allocated, and should be one of the values
   listed in :oe:constns:`OEChem::OEQMolType`.  An
   :ref:`OEMolBase <OEChem_OEMolBase>` or :ref:`OEQMolBase <OEChem_OEQMolBase>` may be
   passed in order to copy construct the :ref:`OEQMolBase <OEChem_OEQMolBase>`
   instance.  The pointer to the :ref:`OEQMolBase <OEChem_OEQMolBase>` memory
   returned by the function is allocated dynamically.  The ``delete``
   operator must be called for all returned instances to prevent memory leaks.

