Ets_Client_State_Handlers_Register()
Note: Requires OPNET Development Kit
Abstract
Registers a client state type and informs the program of the functions to use for copying, deallocating, reading, and writing for client state.
Syntax
Ets_Client_State_Handlers_Register (client_state_type, state_copy_create_proc, state_destroy_proc, state_read_proc, state_write_proc)
| Argument | Type | Description |
|---|---|---|
client_state_type |
const char * |
Unique state registration string |
state_copy_create_proc |
EtsT_Client_State_Copy_Create_Proc |
Handler invoked to copy the state, such as when an object is copied |
state_destroy_proc |
EtsT_Client_State_Destroy_Proc |
Handler invoked when the state needs to be destroyed |
state_read_proc |
EtsT_Client_State_Read_Proc |
Handler invoked when the state needs to be read from disk storage with the scenario |
state_write_proc |
EtsT_Client_State_Write_Proc |
Handler invoked when the state needs to be written to disk with the scenario data |
Return Type
EtsT_Client_State_ID
State represented by these handlers. An invalid value is returned if the registration failed.
Header
ets_pstate.h
Details
To associate some additional information (client state) with objects, you must register a set of handlers that determine how that state is managed. The handlers are used to copy the state (when a scenario is duplicated), destroy the state (when a scenario is destroyed), and read/write the information to/from disk.
The state type can only have one set of associated handlers. Do not register twice with the same type (an error will be reported and an invalid state ID will be returned).
The handler prototypes are given in EtsT_Client_State_Copy_Create_Proc, EtsT_Client_State_Destroy_Proc, EtsT_Client_State_Read_Proc, and EtsT_Client_State_Write_Proc.