Download User Manual

Transcript
136
Qtronic2 Manual
void sleep(double timeout);
4.7 Backward Compatibility with Conformiq Test Generator
QML has number of features provided for backward compatibility with Conformiq Test
Generator adapters.
4.7.1 Optional Fields in Records
In Conformiq Test Generator Action Language elements of a record may be optional,
therefore omitted. In CTG Action Language these optional fields are specified using the
keyword optional. QML language provides also the means to create optional record fields
by using predefined special Optional<T> type.
For example.
record X {
Optional<int> optint;
Optional<X> optx;
}
If a record field is optional, the variables of that type can, but need not, have that field in
them. You can assign a new value with such a field to a variable with no such field and vice
versa.
The omit keyword is used to specify that the field is omitted from the record instance.
Optional fields are omitted by default.
The predefined function ispresent<T>(T) can be used to check if an optional field is
present in a record variable. Note that it is a run-time error to reference an omitted record
field. The signature of this function is given below.