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

.. oe:namespace:: OEChem


.. _OEChem_OESubSearchScreenTypeBase:

.. oe:class:: OESubSearchScreenTypeBase

   .. attention::

      |TWOLANGUAGE|

   .. oe:api::

      class OESubSearchScreenTypeBase

   The :ref:`OESubSearchScreenTypeBase <OEChem_OESubSearchScreenTypeBase>` class provides an interface
   to type :ref:`OESubSearchScreen <OEChem_OESubSearchScreen>` objects.
   The type determines what kind of queries in mind the screen was designed for

   * :term:`SMARTS` patterns
   * :ref:`MDL<chapter_mdlqueries>` queries
   * simple molecule queries with no complex query features

   Screen types can not be constructed by themselves.
   The type of an :ref:`OESubSearchScreen <OEChem_OESubSearchScreen>` object is determined
   when it is initialized by calling either the
   :oe:func:`OEChem::OEMakeSubSearchQueryScreen` or the
   :oe:func:`OEChem::OEMakeSubSearchTargetScreen` function.

   Each screen type has a version number. Version numbers are introduced in
   order to keep track of changes in the screen generation algorithm itself.

   .. seealso::

      * :oe:constns:`OEChem::OESubSearchScreenType` namespace

   .. oe:language:: c++ python

      The following code snippet shows how to interrogate the screen type.

      .. oe:source:: ScreenTypeString.cpp
         :language: c++
         :noindent:
         :frag:     SNIPPET

      .. oe:source:: ScreenTypeString.py
         :language: python
         :noindent:
         :frag:     SNIPPET

      The output of the code is:

      .. code-block:: console

         MDL SubSearch Screen,ver=0.9.0
         0.9.0
         MDL SubSearch Screen


   .. oe:method:: GetName

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

         .. oe:api::

            std::string GetName() const

      .. oe:language:: python

         .. oe:api:: python

            GetName() -> str

      Returns the name of the screen type.

   .. oe:method:: GetScreenType

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

         .. oe:api::

            unsigned int GetScreenType() const

      .. oe:language:: python

         .. oe:api:: python

            GetScreenType() -> int

      Returns the screen type defined in the
      :oe:constns:`OEChem::OESubSearchScreenType` namespace.

   .. oe:method:: GetScreenTypeString

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

         .. oe:api::

            std::string GetScreenTypeString() const

      .. oe:language:: python

         .. oe:api:: python

            GetScreenTypeString() -> str

      Returns the name and the version of the screen type in
      the string format.

   .. oe:method:: GetSize

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

         .. oe:api::

            unsigned int GetSize() const

      .. oe:language:: python

         .. oe:api:: python

            GetSize() -> int

      Returns the number of bits in of the screen type.

   .. oe:method:: GetVersion

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

         .. oe:api::

            unsigned short GetVersion() const

      .. oe:language:: python

         .. oe:api:: python

            GetVersion() -> short

      Returns the current version of the screen type.

   .. oe:method:: GetVersionString

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

         .. oe:api::

            std::string GetVersionString() const

      .. oe:language:: python

         .. oe:api:: python

            GetVersionString() -> str

      Returns the current version of the screen type in the string format,
      such as ``0.9.0`` .

   .. note::

      The version number of various screen types will not be changed with each release.
      It will be incremented only if modifications or bug fixes to the corresponding
      algorithm would result in generating a different screen for the same molecule.

      Screens with an old version number will **not** be supported. But rather it will
      be required to regenerate the screen databases.
