.. oe:namespace:: OESystem

.. meta::
   :keywords: OEBaseData, BaseData


.. _OESystem_OEBaseData:

.. oe:class:: OEBaseData

   .. oe:api::

      class OEBaseData

   :ref:`OEBaseData <OESystem_OEBaseData>` is an abstract class which defines the interface
   necessary for storage, retrieval, and duplication of data stored
   through the generic data interface in the :ref:`OEBase <OESystem_OEBase>`
   class. Data stored in classes derived from :ref:`OEBaseData <OESystem_OEBaseData>` is identified
   through data tags. The ability to perform run-time type checking is
   also built into the class.

   The following classes derive from this class:

    * :ref:`OEBaseDataT <OESystem_OEBaseDataT>`
    * :ref:`OEBaseDataTPtr <OESystem_OEBaseDataTPtr>`

   .. note::

      :ref:`OEBaseData <OESystem_OEBaseData>` is an abstract class. Methods for accessing
      and setting generic data are implemented in its derived class
      :ref:`OEBaseDataT <OESystem_OEBaseDataT>`.

   .. seealso::

      * :oe:meth:`OESystem::OEBaseDataT::GetData` method instead.
      * :oe:meth:`OESystem::OEBaseDataT::SetData` method instead.


   .. oe:method:: Constructors

      .. oe:api::

         OEBaseData(unsigned int tag)

      Constructs and instance of :ref:`OEBaseData <OESystem_OEBaseData>` and set the data identifier
      tag upon construction.

   .. oe:method:: CreateCopy

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

         .. oe:api::

            OEBaseData* CreateCopy() const = 0

      .. oe:language:: python

         .. oe:api:: python

            CreateCopy() -> OEBaseData

      This pure virtual copy constructor should return a deep copy of
      the :ref:`OEBaseData <OESystem_OEBaseData>` object. The copy of the object returned is not
      memory-managed by the parent instance. It is the responsibility
      of the programmer to manage the memory created and returned by
      this method.

   .. oe:method:: GetDataType

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

         .. oe:api::

            const void* GetDataType() const = 0

      .. oe:language:: python

         .. oe:api:: python

            GetDataType() -> void

      This pure virtual method returns a unique type identifier for
      the data type being stored. The return value of the method is
      equivalent to the return value of :oe:func:`OESystem::OEGetDataType`
      for the stored type.

   .. oe:method:: GetSize

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

         .. oe:api::

            unsigned int GetSize() const = 0

      .. oe:language:: python

         .. oe:api:: python

            GetSize() -> int

      This pure virtual method is used to return the number of
      elements if the data stored in an :ref:`OEBaseData <OESystem_OEBaseData>` derived
      class is an array.

      .. note::

         The value returned is the number of elements in
         the array, not the number of bytes occupied by the data.

   .. oe:method:: GetTag

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

         .. oe:api::

            unsigned int GetTag() const

      .. oe:language:: python

         .. oe:api:: python

            GetTag() -> int

      Returns the integer data tag with which the data was
      stored.
