Access Specifiers by Annamalai Viswanathan
This script can be used to add in, out or inout descriptors to operation parameters
or change the in, out or inout parameters already assigned to operation parameters
for the purposes of IDL generation in Rose.
1. Open your model and then open up this script (in the script window).
2. Select the class or classes that contain the operations whose parameters you wish specify access descriptors for. The class(es) may be selected in the browser or in a class diagram.
3. Run the script. A dialog box will pop up with the name of a parameter, its type and the operation that it belongs to. You will be given the option to set the access descriptor to in, out or inout (radio buttons). Choose an access descriptor.
A couple of things to keep in mind:
- While it is possible to specify any class as the parameter type this script will not work if the parameter type begins with an 'out' or a
'in'.
- This script does not add to the functionality of Rose. There is no property that specifies the access specifier of a parameter. All this script does is add the access specifier to the parameter type. This will result in the correct IDL being generated.
Limitations
This script cannot be used in combination with ANSI C++ RTE!!!
The problem arises when reverse engineering the generated code (generation language: ANSI C++). The parser of Rose does not
recognize the access parameters as such but as the argument type itself, thus thinking that the real argument type is the argument itself.
Example:
Model:
void X(ulParam)
argument: ulParam
argument type: IN unsigned long
Generated code:
void X(IN unsigned long ulParam) -----> OK
Reverse engineered model:
void X(unsigned long)
argument: unsigned long
argument type: IN
Download (3KB) (8-Dec-99)
www.rationalrose.com/scripts/access_specifiers.ebs
|