.. include:: headings.inc .. _CustomDataObject: ========================================================================================================================================== |phoenix_title| **CustomDataObject** ========================================================================================================================================== :ref:`CustomDataObject` is a specialization of :ref:`DataObjectSimple` for some application-specific data in arbitrary (either custom or one of the standard ones). The only restriction is that it is supposed that this data can be copied bitwise (i.e. with ``memcpy()`` ), so it would be a bad idea to make it contain a ``C++`` object (though C struct is fine). By default, :ref:`CustomDataObject` stores the data inside in a buffer. To put the data into the buffer you may use either :meth:`~CustomDataObject.SetData` or :meth:`~CustomDataObject.TakeData` depending on whether you want the object to make a copy of data or not. This class may be used as is, but if you don't want store the data inside the object but provide it on demand instead, you should override :meth:`~CustomDataObject.GetSize`, :meth:`~CustomDataObject.GetData` and :meth:`~CustomDataObject.SetData` (or may be only the first two or only the last one if you only allow reading/writing the data). .. seealso:: :ref:`DataObject` | |class_hierarchy| Inheritance Diagram ===================================== Inheritance diagram for class **CustomDataObject** .. raw:: html

Inheritance diagram of CustomDataObject

| |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~CustomDataObject.__init__` The constructor accepts a `format` argument which specifies the (single) format supported by this object. :meth:`~CustomDataObject.GetSize` Returns the data size in bytes. ================================================================================ ================================================================================ | |property_summary| Properties Summary ===================================== ================================================================================ ================================================================================ :attr:`~CustomDataObject.Data` See :meth:`~CustomDataObject.GetData` and :meth:`~CustomDataObject.SetData` :attr:`~CustomDataObject.Size` See :meth:`~CustomDataObject.GetSize` ================================================================================ ================================================================================ | |api| Class API =============== .. class:: CustomDataObject(DataObjectSimple) CustomDataObject is a specialization of DataObjectSimple for some application-specific data in arbitrary (either custom or one of the standard ones). **Possible constructors**:: CustomDataObject(format=FormatInvalid) CustomDataObject(formatName) .. method:: __init__(self, *args, **kw) |overload| **Overloaded Implementations**: **~~~** **__init__** `(self, format=FormatInvalid)` The constructor accepts a `format` argument which specifies the (single) format supported by this object. If it isn't set here, :meth:`DataObjectSimple.SetFormat` should be used. :param `format`: :type `format`: DataFormat **~~~** **__init__** `(self, formatName)` **~~~** .. method:: GetSize(self) Returns the data size in bytes. :rtype: `int` .. attribute:: Data See :meth:`~CustomDataObject.GetData` and :meth:`~CustomDataObject.SetData` .. attribute:: Size See :meth:`~CustomDataObject.GetSize`