1 2 3 4 5 6 7 8 9 10 11 12
13 /*!
14 * ======== IInstance ========
15 * Common instance params
16 *
17 * Every module's instance parameter structure contains a pointer to an
18 * `IInstance.Params` structure named `instance`. So, every instance
19 * parameter defined in this interface may optionally be set when
20 * creating (or constructing) any module's instances.
21 */
22 interface IInstance {
23
24 instance:
25
26 /*!
27 * ======== name ========
28 * Name of the instance
29 *
30 * It is possible to "bind" a name to each instance of any module
31 * at the time the instance is created (or constructed).
32 * @p(code)
33 * ModA_Params params;
34 * ModA_Params_init(¶ms);
35 * params.instance->name = "myInstance";
36 * ModA_create(¶ms, NULL);
37 * @p
38 *
39 * The name field must be assigned a pointer to a buffer that persists
40 * as long as the instance that it names exists. Only a reference to
41 * the name is retained in the instance, the name is not copied to a
42 * secondary buffer.
43 *
44 * If instances have been configured to not support names, it is still
45 * possible to assign to the `instance.name` field of the parameter
46 * structure (as shown above). However, the pointer is not retained
47 * and methods that normally return an instance's name will return
48 * `NULL` instead.
49 */
50 config String name = null;
51 }
52 53 54
55