interface xdc.runtime.IModule |
|
|
|
Base interface for all modules
All modules share a common set of configuration parameters and methods.
[
more ... ]
interface IModule {
module-wide config parameters
}
DETAILS
All modules share a common set of configuration parameters and methods.
INTERNAL
This section provides a terse summary of the methods provided by every
module for use within the module's implementation. Each method's
prototype is shown along with a brief summary of its behavior.
These methods are declared in the module's internal header which should
always be included in any file referencing these functions. For a
module named Mod the following statement includes this header.
#include "package/internal/Mod.xdc.h"
In the protypes below, Mod refers to the module being implemented,
embeddedObj is the name of field in the module's state structure that
is either an embedded object field or an array of such objects, and
fld is the name of a field declared in the module's state structure.
// enter the module's gate
IArg Mod_Module_enter(Gate_Handle gate);
// leave the module's gate
Mod_Module_leave(Gate_Handle, IArg);
// return a pointer to the embeddedObj field
Ptr Mod_Module_State_embeddedObj();
// the value of the fld field of the module's state structure
Mod_module->fld; // fld is declared in module's .xdc file
EXTERNAL
This section provides a terse summary of the methods provided by every
module for use by an application or other modules. Each method's
prototype is shown along with a brief summary of its behavior.
These methods are declared in the module's header which should always
be included in any file referencing these functions. For a
module named Mod in the package named a.b.c, the following statement
includes this header.
In the protypes below, IMod referes to some interface, Mod refers to
a module that (optionally) inherits from IMod, and pkgName is the
name of the package containing the interface IMod.
// methods to operate on modules
// return heap associated with this module
IHeap_Handle Mod_Module_heap();
// get Mod's module ID
Types_ModuleId Mod_Module_id();
// return TRUE if Mod's startup is complete
Bool Mod_Module_startupDone();
// type-safe conversion from an interface to an inheriting module
// Returns NULL if the conversion is not valid
Mod_Handle Mod_Handle_downCast(IMod_Handle handle);
// type-safe conversion from a module to an interface it inherits from
// Returns NULL if the conversion is not valid
IMod_Handle Mod_Handle_upCast(Mod_Module_Handle handle);
// methods to access the instances managed by Mod
// return heap used to create instances
IHeap_Handle Mod_Object_heap();
// return count of static instances
Int Mod_Object_count();
// get the i'th instance object of an array of instance objects
//
// If the array reference is NULL, get the i'th statically created
// instance object.
Mod_Object *Mod_Object_get(Mod_Object *array, Int i);
// get the first "live" runtime instance
Mod_Object *Mod_Object_first();
// get the next "live" runtime instance
Mod_Object *Mod_Object_next(Mod_Object *obj);
// methods that operate on instance handles
// fill in buf structure with instance's label info, returns buf
Types_Label *Mod_Handle_label(Mod_Handle inst, Types_Label *buf);
// returns name of the instance inst, if it has one (otherwise NULL)
String Mod_Handle_name(Mod_Handle inst);
// type-safe conversion of module handle to interface handle
// Returns NULL if the conversion is not valid
IMod_Handle Mod_Handle_to_pkgName_IMod(Mod_Handle inst);
// type-safe conversion of interface handle to module handle
// Returns NULL if the conversion is not valid
Mod_Handle Mod_Handle_from_pkgName_IMod(IMod_Handle inst);
// get the module that created the handle
Mod_Module Mod_Handle_to_Module(Mod_Handle inst);
metaonly config IModule.common$ // module-wide |
|
Common module configuration parameters
DETAILS
All modules have this configuration parameter. Its name
contains the '$' character to ensure it does not conflict with
configuration parameters declared by the module. This allows
new configuration parameters to be added in the future without
any chance of breaking existing modules.
generated on Thu, 27 Sep 2012 23:21:04 GMT