Methods | Description |
---|---|
winfo_item() | The constructor initialises all pointers of the class with NULL. |
operator wait_info*() | Operator to cast a winfo_item object to a wait_info pointer. Actually, the operator simply interprets the union ``data'' as a wait_info pointer and returns it. Note, no checking whether the pointer really references a valid data structure is done. |
operator winfo_item*() | Operator to cast a winfo_item object to a winfo_item pointer. Actually, the operator simply interprets the union ``data'' as a winfo_item pointer and returns it. Note, no checking whether the pointer really references a valid data structure is done. |
winfo_item&operator=(wait_info *a) | Operator to store a wait_info pointer into the winfo_item object. The method returns a reference to the current winfo_item object. |
winfo_item&operator=(winfo_item *a) | Operator to store a winfo_item pointer into the winfo_item object. The method returns a reference to the current winfo_item object. |
Depending on the operations which are performed on a winfo_item instance, the operators will cast the instance to the specific type.
Example:
SIGNAL a, b : INTEGER; ... P:PROCESS BEGIN WAIT ON a; -- Wait statement 1 WAIT ON b; -- Wait statement 2 END PROCESS;
L3lib_E8myentity_A4arch_P1p::L3lib_E8myentity_A4arch_P1p( L3lib_E8myentity_A4arch *arch, name_stack &iname) { ... // other stuff executed in the constructor winfo_item winfo[2]; // Instantiate an winfo_item array consisting // of three elements. Note, the size of the // array can be calculated at compile time. // Each wait_info object is associated with // a separate array element. { sigacl_list salist(1); // instantiate a new signal-ACL list salist.add(arch->S1a); // store sig_info pointer of signal ``b'' winfo[0] = wait_info(salist); // instantiate wait_info object } // for wait statement 1 { sigacl_list salist(1); // instantiate a new signal-ACL list salist.add(arch->S1b); // store sig_info pointer of signal ``a'' winfo[1] = wait_info(salist); // create wait_info object for } // wait statement 2 } void L3lib_E8myentity_A4arch_P1p::execute() { switch (jmp) { case 1: goto lab1; case 2: goto lab2; } lab0: jmp = 1; // store where to continue next time kernel.wait(winfo[0]); // pass sensitivity information to the kernel return; // and suspend execution lab1: jmp = 2; // store where to continue next time kernel.wait(winfo[1]); // pass sensitivity information to the kernel return; // and suspend execution lab2: goto lab0; }