.. oe:namespace:: OESystem

.. meta::
   :keywords: OEBaseDataT, BaseDataT


.. _OESystem_OEBaseDataT:

.. oe:class:: OEBaseDataT

   .. oe:api::

      template<class T>
      class OEBaseDataT : public OEBaseData

   This class represents `OEBaseDataT`.

   The following methods are publicly inherited from :ref:`OEBaseData <OESystem_OEBaseData>`:

   ========================================================= ======================================================== ========================================================
   :oe:meth:`CreateCopy<OESystem::OEBaseData::CreateCopy>`   :oe:meth:`GetSize<OESystem::OEBaseData::GetSize>`
   :oe:meth:`GetDataType<OESystem::OEBaseData::GetDataType>` :oe:meth:`GetTag<OESystem::OEBaseData::GetTag>`
   ========================================================= ======================================================== ========================================================


   The following specializations exist for this template:

    * OESystem::OEBaseDataT< int >


   The following classes derive from this class:
    * :ref:`OEBaseDataTPtr <OESystem_OEBaseDataTPtr>`

   .. oe:method:: Constructors

      .. oe:api::

         OEBaseDataT(unsigned int tag, const T& t)

      Constructs an :ref:`OEBaseDataT <OESystem_OEBaseDataT>` object that
      stores data with ``T`` type associated with
      the given ``tag`` identifier.

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

      .. oe:api::

         OEBaseDataT<T>& operator=(const OEBaseDataT<T>& t)

      Assignment operator.

   .. oe:method:: CreateCopy

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

         .. oe:api::

            OEBaseData* CreateCopy() const

      .. oe:language:: python

         .. oe:api:: python

            CreateCopy() -> OEBaseDataT

      Deep copy constructor that returns a copy of the object.
      The memory for the returned :ref:`OEBaseDataT <OESystem_OEBaseDataT>`
      object is dynamically allocated and owned by the caller.

      .. oe:language:: c++

         The returned copy should be deallocated using C++
         delete operator in order to prevent a memory leak.

   .. oe:method:: GetData

      .. oe:api::

         T& GetData()
         const T& GetData() const

      Returns the data stored int the :ref:`OEBaseDataT <OESystem_OEBaseDataT>` object.

   .. oe:method:: GetDataType

      .. oe:api::

         const void* GetDataType() const

      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:api::

         unsigned int GetSize() const

      Returns the number of elements stored in the an
      :ref:`OEBaseDataT <OESystem_OEBaseDataT>` object that is always ``1``.

      .. note::

         The value returned is not the number of bytes occupied by the data.

   .. oe:method:: SetData

      .. oe:api::

         bool SetData(const T& t)

      Sets the data stored int the :ref:`OEBaseDataT <OESystem_OEBaseDataT>` object.
