The signature of an operation consists of its name and all its parameters (including the return parameter, which defines the return type of the operation). You can view and edit the signature in the General tab of the Properties view when an operation is selected. The operation signature is also visible and sometimes editable in other places in the DevOps Model RealTime user interface. Some examples are:
Model RealTime supports a subset of the textual syntax for operation signatures that is standardized in the UML specification (UML Superstructure Specification v. 2.3, chapter 7.3.36 Operation):
*[<visibility>] <name> '(' [<parameter-list>] ')' [':' [<return-type>] ['[' <multiplicity> ']']*
Items within square brackets are optional. The different parts of this signature syntax are explained below:
~«» op ()
Definition of an operation 'op' with package visibility (indicated by a small package decorator in the Project Explorer):
«» ~C () Definition of an operation with the name ~C. It is a destructor in the context of C++ code generation.
The visibility part of the signature syntax only applies when editing a signature. It is not shown otherwise. A decorator on the operation icon shows the visibility of the operation.
'['<direction>']' <parameter-name> ':' <type-expression> ['['<multiplicity>']'] ['=' <default>]
Here are some examples of operations with different kinds of parameters:
«» op ( [in] y : int = 4 )
Operation with one [in] parameter 'y' of type 'int' and with default value 4.
«» op ( [inout] z : bool, [in] s : CPPModel::Class1 ))
Operation with one [inout] parameter 'z' of type 'bool' and one [in] parameter 's' typed by a class "Class1" in the model package "CPPModel".
A return type for the operation can be specified after a colon at the end of the signature. You can also specify a multiplicity for the return parameter using square brackets. An example:
«» op ( [in] s : char* )) : int[10]
Operation with one [in] parameter 's' of type 'char*' and with a return parameter of type 'int' and multiplicity 10.
Not all parts of the signature syntax are supported when modifying an existing operation. If you find that a modification of the signature for an existing operation does not produce the desired result, you can edit the operation and its parameters using the other fields in the Properties view.