// Generated from service.c - manual changes will be lost
ifdef::sidebartoc[]
include::_Sidebar.adoc[]
endif::[]






































== *$service* TCL engine command

Those commands manipulate service objects and return information about
them. They all take a service object as their first argument, noted
`$service` in the following command descriptions. Such an object is
typically returned by other procedures, such as
link:cmd-component{outfilesuffix}#services[`$component services`].




























































[[name]]
=== *$service name*

Return the name of the service as a string.






[[kind]]
=== *$service kind*

Return a string that is either `attribute`, `function` or `activity`
depending on the kind of service.






[[visibility]]
=== *$service visibility*

Return either `hidden` or `default` depending on the visibility of the
service.







[[component]]
=== *$service component*

Return the link:cmd-component{outfilesuffix}[component object] in which
the service is defined.






[[doc]]
=== *$service doc*

Return a string containing the documentation of the service defined
in the `doc` attributes of the `.gen` description.







[[before]]
=== *$service before*

Return a list of services that cannot run until this service has
been executed sucessfully at least once.

[[after]]
=== *$service after*

Return a list of services that must must have been successfully
executed at least once before this service can run.

[[interrupts]]
=== *$service interrupts*

Return a list of services that will be interrupted whenever this
service is executed.



























[[task]]
=== *$service task*

Return the link:cmd-task{outfilesuffix}[task object] in which
the service is defined, or an error if the service has no task context
(i.e. the service is an `attribute` or a `function).








[[throws]]
=== *$service throws*

Return a list of link:cmd-type{outfilesuffix}[`exceptions`] possibly
raised by the service.





























































[[codels]]
=== *$service codels* [[validate|simple|fsm] ...]

Return the list of link:cmd-codel{outfilesuffix}[codels] defined in
the service. The list may be filtered by a keyword described
below. Multiple keyword may be given: they are combined with an
implicit 'or'.

.Arguments
[horizontal]
'validate':: Return the validation codels.
'simple':: Return the simple codels of functions.
'fsm':: Return the codels associated with activities and a state
machine.













































[[params]]
=== *$service params* [[local|in|out|inout] ...]

Return the list of parameters of the service. One or several direction
filter may be specified to filter the list according to the or'ed
combination of the directions.

.Arguments
[horizontal]
'local':: The parameters that are private to the running instance of the
service.
'in':: The parameters that input to the service.
'out':: The parameters that output by the service.
'inout':: The parameters that both input to and output by the service.















































[[fsm]]
=== *$service fsm* ['state'] [type|codel]

When called without argument, `$service fsm` returns the list of
link:cmd-type{outfilesuffix}[states] defined in the finite state
machine of the service.

When called with one of the states (or state name) as argument,
optionally followed by the `codel` keyword, the procedure returns the
link:cmd-codel{outfilesuffix}[codel] object associated with that
state.

When called with one of the states name as argument and the `type`
keyword, the link:cmd-type{outfilesuffix}[type] object associated with
that state is returned.

















































[[mutex]]
=== *$service mutex*

Return a list of link:cmd-codel{outfilesuffix}[`codels`] that may access
internal resources used by the service. All these codels cannot run
when the service is running.



















[[digest]]
=== *$service digest*

Return a string containing a MD5 hash of the service. The hash is
computed using the service name and the ordered list of parameters
direction and type.



















[[loc]]
=== *$service loc* [file|line|column|context]

Return a list describing the source location where that service 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.







[[class]]
=== *$service class*

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














// eof
