Automatic guessing on parameters

Automatic guessing on parameters happens when Cxx Designer is generating the code for a parameter for which the automatic generation flag is set.

For parameters, the automatic guessing algorithm selects the best way of passing a parameter, based on good practices:

  • Basic types by value

  • Complex types by const reference or pointers

The Cxx Designer generator also takes care of the parameter passing mode (In or InOut) in order to further optimize the generated code.

Automatic guessing on "In" parameters

The following list shows the generated declaration for a parameter named "param". Please note that the use of const values is favored due to the "In" mode.

  • Parameter type: integer

  • Parameter type: string

  • Parameter type: MyClass

  • Parameter type: MyDatatype (isPrimitive=true)

  • Parameter type: MyDatatype (isPrimitive=false)

Note 1: Where the table states integer, this can be any basic type (integer, char, float, boolean).

Note 2: An element typed undefined is generated as void*.

Automatic guessing on "InOut" parameters

The following liste shows the generated declaration for a parameter named "param". Please note that no const values are used due to the "InOut" mode.

  • Parameter type: integer

  • Parameter type: string

  • Parameter type: MyClass

  • Parameter type: MyDatatype (isPrimitive=true)

  • Parameter type: MyDatatype (isPrimitive=false)

Note 1: Where the table states integer, this can be any basic type (integer, char, float, boolean).

Note 2: An element typed undefined is generated as void*.