EtsT_Ma_Block_Handler
Note: Requires OPNET Development Kit
Abstract
Handles actions when the user executes the Apply Model Assistant File operation.
Syntax
<block_handler_name> (block_handle, state_ptr)
| Argument | Type | Description |
|---|---|---|
block_handle |
PrgT_File_Parse_Block_Handle |
Handle to a block of data |
state_ptr |
void* |
Pointer to an object or list. Ets_Ma_Files_Apply() passes this pointer to the block handler. |
Return Type
EtsT_Compcode
EtsC_Compcode_Success if the block of data was imported into the network successfully, EtsC_Compcode_Failure otherwise.
Header
ets_api_ma.h
Details
A block handler function defines the callbacks that are called when a model assistant file is read, and a block is found that matches the name specified in the Ets_Ma_Files_Apply() function. A block handler might apply the data directly, or it might call other helper functions to apply the data.
The <state_ptr> argument is passed from the caller of the Ets_Ma_Files_Apply() function. If the block handler needs to reference an external object, you can use this argument to pass a pointer to that object. Developers who write their own custom block handlers can make <state_ptr> reference anything they want. For example, you might want to pass a pointer to a hash table of network objects. The handler could use this table to match names in the model assistant files with objects in the network.