From RTSC-Pedia

Jump to: navigation, search
revision tip
—— LANDSCAPE orientation
[printable version]  [offline version]offline version generated on 04-Aug-2010 21:08 UTC

XDCspec - @InstanceFinalize

This module's instances require finalization

This attribute is applicable only to modules with instances. If this attribute is specified for a module, its internal instance finalize function (Mod_Instance_finalize) is called when the instance is deleted, destructed, or if the instance initializer returns an error (see @InstanceInitError ). The finalize method is passed two input parameters:

  1. the pointer to the instance object being deleted, and
  2. an integer status value; if @InstanceInitError is also specified, this status is either the return value from Mod_Instance_init or 0, otherwise this status value is not initialized.

The fragments below illustrates the instance finalize method signature for a module named Foo both with and without the @InstanceInitError attribute.

with @InstanceInitError
 
 
 
 
 
 
 
 
#include "package/internal/Foo.xdc.h"
 
/* state is the return value of Foo_Instance_init() */
Void Foo_Instance_finalize(Foo_Object *obj, Int state)
{
    /* use state to know what needs to be finalized */
       :  
}

without @InstanceInitError
 
 
 
 
 
 
#include "package/internal/Foo.xdc.h"
 
Void Foo_Instance_finalize(Foo_Object *obj)
{
       :
}
[printable version]  [offline version]offline version generated on 04-Aug-2010 21:08 UTC
Copyright © 2008 The Eclipse Foundation. All Rights Reserved


Views
Personal tools
package reference