Ets_Ma_Files_Apply()
Note: Requires OPNET Development Kit
Abstract
Given a list of model assistant files and a block name, applies a handler to all blocks with the specified name.
Syntax
Ets_Ma_Files_Apply (file_lptr, block_name, handler, state_ptr)
| Argument | Type | Description |
|---|---|---|
file_lptr |
PrgT_List* |
List of model assistant data files |
block_name |
const char* |
Block name of the data to process |
handler |
EtsT_Ma_Block_Handler |
Handler function to process the specified data |
state_ptr |
void* |
Pointer to an object or list. The function passes this pointer to the block handler. |
Return Type
EtsT_Compcode
Header
ets_api_ma.h
Details
This function provides a mechanism for applying a handler to a block of data.This function is called to apply model assistant file blocks to the current network. It can be used in the following ways:
- If both
block_nameandhandlerare supplied, this function iterates throughfile_listand applieshandlerto all blocks of typeblock_name. - If
block_nameis supplied buthandleris NULL, this function iterates throughfile_listand applies the default core handler to all blocks of typeblock_name. If no default handler is defined forblock_name, this function does nothing. - If
handleris supplied butblock_nameis NULL, this function returns an error reporting that this is an invalid input. - If both
handlerandblock_nameare NULL, this function applies default handlers for all blocks named in the model assistant configuration file (see Package Overview for more information about this file). If the configuration file does not specify a handler for a block, the import engine skips that block.
The state pointer gets passed to the handler, as described in EtsT_Ma_Block_Handler. If the handler needs to reference an external object, you can use this argument to pass a pointer to that object.
You can specify one of the standard block handlers for the handler argument. If you call one of these handlers, pass NIL for the state_ptr argument. To see the declarations for these handlers, look in the file <reldir>/sys/include/ets_api.h.