Main Page Namespace List Class Hierarchy Alphabetical List Compound List Namespace Members Compound Members Related Pages

# Edit::DataBlockI Class Reference

Plugin data interface. More...

`#include <DataBlockI.h>`

Inheritance diagram for Edit::DataBlockI:

List of all members.

## Public Methods

- virtual DataBlockI* create () = 0
- virtual void release ()
- virtual void copy ( DataBlockI* pBlock ) = 0

## Protected Methods

- DataBlockI ()
- virtual ~DataBlockI ()

## Detailed Description

Plugin data interface.

Data block class is base class for every object created in a plugin class in a DLL and returned to the Demopaja system. Data block class takes care that the memory management of the main application and the plugin won't corrupt. This class also hides the constructor and destructor to prevent the misuse of the classes derived from this class.

## Constructor & Destructor Documentation

DataBlockI ( | )`[protected]`

| Protected default constructor.

~DataBlockI ( | )`[protected, virtual]`

| Protected default desctructor.

## Member Function Documentation

void copy ( | DataBlockI * pBlock )`[pure virtual]`

  | Deep copy from a data block. Parameters:
  pBlock | Pointer to datablock of same class to data from.
This method should make a deep copy (that is, copy everything) of the instance specified by the argument.
                Example Implementation
                void
                TGAImportC::copy( DataBlockI* pBlock )
                {
                    TGAImportC* pFile = (TGAImportC*)pBlock;

                    m_i32Width = pFile->m_i32Width;
                    m_i32Height = pFile->m_i32Height;
                    m_i32Bpp = pFile->m_i32Bpp;
                    m_sFileName = pFile->m_sFileName;

                    // duplicate data
                    delete m_pData;
                    uint32 ui32DataSize = m_i32Width * m_i32Height * (m_i32Bpp / 8);
                    m_pData = new uint8[ui32DataSize];
                    memcpy( m_pData, pFile->m_pData, ui32DataSize );
                }
Reimplemented in Composition::ControllerC, Edit::EditableI, Composition::EffectI, Import::FileHandleC, Import::FileListC, Composition::GizmoI, Composition::KeyC, Composition::LayerC, Composition::ParamI, Composition::ParamIntC, Composition::ParamFloatC, Composition::ParamVector2C, Composition::ParamVector3C, Composition::ParamColorC, Composition::ParamTextC, Composition::ParamFileC, Composition::SceneC, and Composition::TimeSegmentC.

DataBlockI * create ( | )`[pure virtual]`

| Creates new datablock. The create method of data block class creates new instance of the same class the data block is. Example implementation:
                DataBlockI*
                TGAImportC::create()
                {
                    return new TGAImportC;
                }
Returns: Pointer to a new instance of this class. Reimplemented in Composition::ControllerC, Edit::EditableI, Import::FileHandleC, Import::FileListC, Composition::KeyC, Composition::LayerC, Composition::ParamIntC, Composition::ParamFloatC, Composition::ParamVector2C, Composition::ParamVector3C, Composition::ParamColorC, Composition::ParamTextC, Composition::ParamFileC, Composition::SceneC, and Composition::TimeSegmentC.

void release ( | )`[virtual]`

| Deletes data block. This method should delete all the contents of this class. The default implementation is shown below. So in practice, you can implement the desctructor method to release the data as usual. The default implementation of this method is:
                void
                DataBlockI::release()
                {
                    delete this;
                }

The documentation for this class was generated from the following file:

- DataBlockI.h