$param TCL engine command

## Contents

- Your rights

- Introduction

- Component model

- Component description file

- GenoM IDL mappings

- Running GenoM

- Tutorials

- Templates

  - Skeleton

  - Mappings

  - Interactive

  - Creating Templates

    - `template` command

    - `engine` command

    - `dotgen` command

    - `language` command

    - `$type` command

    - `$component` command

    - `$port` command

    - `$task` command

    - `$service` command

    - `$codel` command

    - `$param` command

## $param TCL engine command

Those commands manipulate parameter objects and return information about them. They all take a parameter object as their first argument, noted `$param` in the following command descriptions. Such an object is typically returned by other procedures, such as `$codel params`.

### $param name

Return the name of the parameter as a string.

### $param src

Return a string indicating the origin of the parameter:

`ids` | defined in the IDS.
`local` | defined locally for a running instance of a service.
`port` | for port objects passed as a parameter.
`remote` | for remote objects passed as a parameter.

### $param dir

Return a string indicating the direction of the parameter:

`local` | defined locally for a running instance of a service.
`in` | passed as input.
`out` | passed as output.
`inout` | passed as input and output.

### $param member

For `ids` parameters, this returns a valid string in the current programming language to access the parameter inside the IDS. For other kinds of parameters, this raises an error.

### $param base

This returns the type of the source of the parameter. For `local` parameters, this is the type of the local parameter in the service definition. For IDS parameters, this is the `ids` type. For `port` or `remote` kinds, this is the port or remote object.

### $param type

This returns the type object of the parameter.

### $param port

This returns the port object of `port` parameters.

### $param remote

This returns the remote object of `remote` parameters.

### $param param

This returns the service parameter of `local` parameters passed to a codel.

### $param initializer

This returns the initializer object associated to the parameter, or an error if there is no initializer.

An initializer object defines the following methods:

`member` | A valid string in the current programming language to access the initialized member of the parameter.
`doc` | The documentation of this initializer.
`kind` | The data type of the default value of the parameter, or the string `compound` for recursive initializers.
`value` | This is either a constant value object of the type `kind`, or a recursively defined initializer object if `kind` is equal to `compound`.
`loc` | Returns the source location as a triplet.
`class` | Always returns "initializer".

### $param loc [file|line|column|context]

Return a list describing the source location where that parameter is defined. The list contains four elements: the file name, the line number, the column number and the original component context of the definition. If an optional argument is given, only the corresponding element is returned.

### $param class

Always returns the string "parameter". Useful to determine at runtime that the object is a parameter object.