.. include:: ../substitutions

.. oe:namespace:: OEChem

.. meta::
   :keywords: OENewMCMolBase

.. oe:function:: OENewMCMolBase

   .. oe:api::

      OEMCMolBase* OENewMCMolBase(unsigned int type = OEMCMolType::OEDefault)
      OEMCMolBase* OENewMCMolBase(const OEMolBase& mol,
                                  unsigned int type = OEMCMolType::OEDefault)
      OEMCMolBase* OENewMCMolBase(const OEMCMolBase& mol,
                                  unsigned int type = OEMCMolType::OEDefault)
      OEMCMolBase* OENewMCMolBase(const OESystem::OEBase& b,
                                  unsigned int type = OEMCMolType::OEDefault)

   The :oe:func:`OEChem::OENewMCMolBase` factory functions allocate an
   implementation of an :oe:cls:`OEMCMolBase<OEChem::OEMCMolBase>` 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::OEMCMolType` namespace.  An
   :ref:`OEMolBase <OEChem_OEMolBase>` or :oe:cls:`OEMCMolBase<OEChem::OEMCMolBase>` may be
   passed in order to copy construct the :oe:cls:`OEMCMolBase<OEChem::OEMCMolBase>`
   instance.  The pointer to the :oe:cls:`OEMCMolBase<OEChem::OEMCMolBase>` memory
   returned by the function is allocated dynamically.  The ``delete``
   operator must be called for all returned instances to prevent memory leaks.

