The GEN command enables you to generate an event to an object in the executable program. The command can be executed with or without parameters.
<instanceName>->GEN(<eventName>(<parameterName>
[, <parameterName>]*))
<instanceName>->GEN(<eventName>())
<instanceName>->GEN(<eventName>)
instanceName
Specifies the canonical name of an instance or a navigation expression.
A canonical name can be:
A navigation expression can be:
A canonical name always refers to the same instance. A navigation expression can refer to different instances at different times. For example, B[#0] might refer to instance B[4] if instances B[0] to B[3] are deleted.
eventName
Specifies the name of the event to be generated. If the event requires parameters, include them in the GEN command.
If an event has parameters, the GEN command provides the event with the correct number of parameters and the correct types. For example, to generate an event, X where X is defined as X(int, B*, char*), and B is a class defined in IBM® Rational® Rhapsody®, enter:
A[1]->GEN(X(3,B[5],"now"))
or
A[1]->GEN(X(1,NULL,"later"))
When the parameters of an event are
not pointers to classes defined in Rational Rhapsody (for
example int, char*, or userType (where userType is
a user-defined type defined outside Rational Rhapsody),
the tracer relies on the C++ operator >> (istream&) or
the template string2X(T& t) to interpret the
characters you type in correctly. A[1]->GEN(Y(1)) works
because the operator >> converts the character
1 to the integer 1, but
A[1]->GEN(Y(one)) does
not work because the operator >> does not convert
the characters "one" to an integer. Similarly, if you use a type you
defined outside Rational Rhapsody,
you have to provide an operator >> operation
for it if you want to generate events to it through the tracer.