.. oe:namespace:: OESystem



.. meta::
   :keywords: OERole, Role


.. _OESystem_OERole:

.. oe:class:: OERole

   .. oe:api::

      class OERole

   This class represents `OERole`, an object that can be used
   in a some classification scheme to define a category or role.
   Each `OERole` is defined by a `role name` string.

   .. oe:source:: RoleSet.py
      :language: python
      :noindent:
      :frag:     SNIPPET-CREATE-ROLE-OBJECT

   .. oe:source:: RoleSet.cpp
      :language: c++
      :noindent:
      :frag:     SNIPPET-CREATE-ROLE-OBJECT

   Objects inherited from :ref:`OERoleSet <OESystem_OERoleSet>` can
   have :oe:cls:`OERole<OESystem::OERole>` objects added
   to them as a way of marking them for particular uses.

   .. oe:source:: RoleSet.py
      :language: python
      :noindent:
      :frag:     SNIPPET-ADD-ROLE-OBJECT

   .. oe:source:: RoleSet.cpp
      :language: c++
      :noindent:
      :frag:     SNIPPET-ADD-ROLE-OBJECT

   .. oe:method:: Constructors

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

         .. oe:api::

            OERole()
            OERole(const OERole& rhs)

      .. oe:language:: python

         .. oe:api:: python

            OERole() -> OERole
            OERole(rhs: OERole) -> OERole

      Default and copy constructors.

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

         .. oe:api::

            OERole(const std::string& name)

      .. oe:language:: python

         .. oe:api:: python

            OERole(name: str) -> OERole

      Standard constructor. It is recommended that classification schemes
      use hierarchical naming systems, such as ``oebio:component:cofactor``,
      so that they will not conflict with one another when multiple schemes
      are mixed together.

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

      .. oe:api::

         OERole &operator=(const OERole &rhs)

      Assignment operator.

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

      .. oe:api::

         bool operator<(const OERole &rhs) const

      Allows :oe:cls:`OERole<OESystem::OERole>` objects to be ordered.

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

      .. oe:api::

         bool operator==(const OERole &rhs) const

      Allows :oe:cls:`OERole<OESystem::OERole>` objects to be compared for equivalence.

   .. oe:method:: GetName

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

         .. oe:api::

            const char* GetName() const

      .. oe:language:: python

         .. oe:api:: python

            GetName() -> str

      Returns the character string representing the name of the role.
      An empty character string is returned for a default :oe:cls:`OERole<OESystem::OERole>`
      or one constructed with a random unsigned integer.
