Ets_Obj_Client_State_Set()
Note: Requires OPNET Development Kit
Abstract
Deallocates any installed client state on the object by calling state_destroy_proc, and sets the client's state on the object.
Syntax
Ets_Obj_Client_State_Set (obj_hndl, client_ID, client_state_ptr)
| Argument | Type | Description |
|---|---|---|
obj_hndl |
EtsT_Obj_Handle |
Handle to object that you want state stored on |
client_ID |
EtsT_Client_State_ID |
An object can have many different client state types. This identifies your client state type. |
client_state_ptr |
void * |
Pointer to your structure that you want installed. |
Return Type
EtsT_Compcode
EtsC_Compcode_Success if the client state is successfully installed, EtsC_Compcode_Failure otherwise.
Header
ets_pstate.h
Details
This function installs the client state pointer on the indicated object. This function follows a pattern similar to the pattern used for getting and setting structure fields in a simulation packet. Calling Ets_Obj_Client_State_Set() sets the client state into the object. At that point the object acts as the owner of that memory. If the object is deleted, it will deallocate the client state. Calling Ets_Obj_Client_State_Get() removes the client state from the object.
Only links, subnets and nodes support client state. Other ETS object types (such as annotation, compound attribute objects, and subobjects) do not support Ets_Obj_Client_State_Set().
Once your client state is installed, the state will be copied when the object is copied, written when the model is written, deallocated when the object is deleted.