VIRTUAL PROCSEND

System Testing Test Script Language.

For C++ only.

The VIRTUAL keyword modifies the PROCSEND statement, allowing it to handle messages using C++ inheritance.

Syntax

VIRTUAL PROCSEND <message_type>: <msg> ON <commtype>: <id>

END CALLBACK

Description

The PROCSEND instruction allows you to define a message-sending procedure using C++ classes.

<message_type> is a message type, previously declared with a C++ typedef statement. Syntax using <message_type>* is not allowed.

<msg> is the output parameter of <message_type> that must be a polymorphic C++ class, which means that it must contain at least one virtual method.

<commtype> is the type of communication used for reading messages.

<id> is the input connection parameter on which a message must be read.

Associated Rules

Because a single VIRTUAL PROCSEND can read several message types, the implicit choice of a PROCSEND may be ambiguous. The following rules apply:

  1. If a PROCSEND exists for a given <message type>, System Testing chooses it.

    If not, and if the message type is actually a virtual class, then System Testing chooses the VIRTUAL PROCSEND with the closest type in terms of path in the inheritance diagram of <message_type>.

    If more than one VIRTUAL PROCSEND can be chosen by following the above rules, the PROCSEND is ambiguous and System Testing produces an error.

Example

VIRTUAL PROCSEND pt_high_level_message : msg  ON appl_comm : id_stack

CALL send_message (msg) @ err_ok

END PROCSEND

 

This VIRTUAL PROCSEND example allows you to send high_level_message, ack, negack et data message types, as shown on the following lines:

MESSAGE data : a_data

MESSAGE ack : my_ack

MESSAGE negack : my_neg_ack

MESSAGE high_level_message : hm

VAR a_data, INIT={applname=>"SATURN",userdata=>"Hello Saturn!"}

 SEND( a_data , appl_ch )

VAR my_ack, INIT={applname=>"SATURN"}

 SEND(my_ack , appl_ch )

VAR my_neg_ack, INIT={applname=>"SATURN"}

SEND(my_neg_ack , appl_ch )

Related Topics

CALLBACK ... END CALLBACKPROCSEND ... END PROCSENDVIRTUAL CALLBACKSEND