.. index:: pair: class; DataPack .. _doxid-class_data_pack: template class DataPack ======================= .. toctree:: :hidden: Overview ~~~~~~~~ Base datapack class. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include template class DataPack: public :ref:`DataPackInterface` { public: // construction :target:`DataPack`( const std::string& name, const std::string& engineName, DATA_TYPE* data_ ); :target:`DataPack`(const std::string& name, const std::string& engineName); :target:`DataPack`(const DataPack&); :target:`DataPack`(DataPack&& obj); // methods DataPack& :target:`operator =` (const DataPack&); DataPack& :target:`operator =` (DataPack&&); const DATA_TYPE& :ref:`getData`() const; PyObject* :ref:`toPythonString`(); virtual :ref:`DataPackInterface`* :ref:`clone`() const; static std::string :ref:`getType`(); static :ref:`DataPackIdentifier` :ref:`createID`( const std::string& name, const std::string& engineName ); static void :target:`create_python`(const std::string& name); }; // direct descendants template class :ref:`RawData`; Inherited Members ----------------- .. ref-code-block:: cpp :class: doxyrest-overview-inherited-code-block public: // typedefs typedef std::shared_ptr :ref:`shared_ptr`; typedef std::shared_ptr :ref:`const_shared_ptr`; typedef std::unique_ptr :ref:`unique_ptr`; typedef std::unique_ptr :ref:`const_unique_ptr`; // methods :ref:`DataPackInterface`& :ref:`operator =` (const :ref:`DataPackInterface`&); :ref:`DataPackInterface`& :ref:`operator =` (:ref:`DataPackInterface`&&); const std::string& :ref:`name`() const; void :ref:`setName`(const std::string& name); const std::string& :ref:`type`() const; void :ref:`setType`(const std::string& type); const std::string& :ref:`engineName`() const; void :ref:`setEngineName`(const std::string& engineName); const :ref:`DataPackIdentifier`& :ref:`id`() const; void :ref:`setID`(const :ref:`DataPackIdentifier`& id); virtual :ref:`DataPackInterface`* :ref:`clone`() const; bool :ref:`isEmpty`() const; bool :ref:`isUpdated`() const; void :ref:`resetIsUpdated`() const; .. _details-class_data_pack: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Base datapack class. The class must be specialized by providing a template argument. The argument defines what data class will be stored in the datapack objects. Methods ------- .. index:: pair: function; getData .. _doxid-class_data_pack_1a3ca8d37fbc23195de656d24592b30834: .. ref-code-block:: cpp :class: doxyrest-title-code-block const DATA_TYPE& getData() const Returns reference to data stored in the object. The function returns a read-only reference to the data stored by the object. This is the main accessor function of the :ref:`DataPack ` object. .. rubric:: Returns: Read-only reference to the data stored by the object .. index:: pair: function; toPythonString .. _doxid-class_data_pack_1a6083d8d85478dc68e2ccfd6d8091e63f: .. ref-code-block:: cpp :class: doxyrest-title-code-block PyObject* toPythonString() Returns a python string representation of this object content. .. rubric:: Returns: Python string .. index:: pair: function; clone .. _doxid-class_data_pack_1a6480f49617693f976a876b80e2671fdd: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual :ref:`DataPackInterface`* clone() const Virtual clone method to support polymorphic copy. .. index:: pair: function; getType .. _doxid-class_data_pack_1ae6b41eeae3e3616ec74051b493b50c86: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::string getType() Returns type of the datapack class. The function returns type of the datapack class as string. The return value is not human readable. It's an implementation-defined name of the DATA_TYPE used by the datapack. .. index:: pair: function; createID .. _doxid-class_data_pack_1a6d6ec1e24e2e6bedd43a631e1ed49e3b: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`DataPackIdentifier` createID( const std::string& name, const std::string& engineName ) Creates a :ref:`DataPackIdentifier ` object with type matching the DATA_TYPE used by the :ref:`DataPack ` class. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - name - Name of the datapack * - name - Name of the engine to which the datapack belongs .. rubric:: Returns: A :ref:`DataPackIdentifier ` object, with :ref:`DataPackIdentifier::Name ` and :ref:`DataPackIdentifier::EngineName ` provided as arguments, and with :ref:`DataPackIdentifier::Type ` deduced from DATA_TYPE template argument of the :ref:`DataPack ` class.