Next: , Previous: , Up: Listing a Multinode Model   [Contents][Index]


4.4.3 Entity References

Entity references identify entities existing in a multinode model. This identification is necessary when enumerating entities in the multinode model and when passing information about entities associated with an occurred error to a model error handler. See Error Handling for a Multinode Model, for information about the error handler of a multinode model. The header file refe.h contains declarations related to entity references. The notion of entity referred to by an entity reference has nothing to do with virtual or logical entities represented by the state models of nodes of a multinode model.

The basic type of an entity reference is local entity reference. A local entity reference identifies an entity within some known context. The following enumeration declares the types of local entity references.

Enumeration: qsmm_lref_e

This enumeration categorizes entities that are parts of a multinode model. The enumeration contains the following elements.

QSMM_LREF_INVALID

Invalid entity type. This element indicates unknown entity type or the type of a nonexistent entity.

QSMM_LREF_INSTR_CLASS_SET

An instruction class set.

QSMM_LREF_INSTR_META_CLASS

An instruction meta-class.

QSMM_LREF_NODE

A node.

QSMM_LREF_PROB_VAR_CTRL

A controlled probability variable. See Controlled Variables.

QSMM_LREF_PROB_VAR_OUT

An output probability variable. See Output Variables.

QSMM_LREF_PROB_ARR_OUT

An output probabilities array. See Getting Output Probabilities Arrays.

QSMM_LREF_INSTR_CLASS

An instruction class.

QSMM_LREF_COUNT

The number of supported types of local entity references.

The following union represents a local entity identifier for a local entity reference.

Union: qsmm_lref_u

This union holds a local entity identifier for a local entity reference with the type specified by an element of qsmm_lref_e enumeration. The union contains the following fields.

Field: char *name

An entity name. It is applicable to local entity references of QSMM_LREF_INSTR_CLASS_SET, QSMM_LREF_INSTR_META_CLASS, QSMM_LREF_PROB_VAR_CTRL, QSMM_LREF_PROB_VAR_OUT, and QSMM_LREF_PROB_ARR_OUT types.

Field: qsmm_sig_t sig

A local entity identifier represented by a signal. It is applicable to local entity references of QSMM_LREF_NODE type.

Field: struct qsmm_instr_class_s instr_class

An instruction class descriptor. It is applicable to local entity references of QSMM_LREF_INSTR_CLASS type.

The following structure holds an instruction class descriptor in the field instr_class of qsmm_lref_u union for local entity references of QSMM_LREF_INSTR_CLASS type.

Structure: qsmm_instr_class_s

This structure holds an instruction class descriptor identifying an instruction class. The structure contains the following fields.

Field: char *meta_class_name

An instruction meta-class name.

Field: char *param_str_p

Text instruction class parameters in the canonical form (see Setting Text Instruction Parameters). The empty string means empty text parameters. The NULL value means that the text parameters are unknown.

Field: qsmm_sig_t idx

An instruction class index. It uniquely identifies the instruction class in an instruction class set. The value QSMM_SIG_INVALID means that the index is unknown.

Field: size_t param_bin_sz

The size of binary instruction class parameters. If binary parameters are unknown, this field must be equal to 0.

Field: void *param_bin_p

Binary instruction class parameters. If this field is not NULL, it must address a memory block with size in bytes specified by the field param_bin_sz. If this field is NULL, then binary parameters are unknown, and the field param_bin_sz must be equal to 0.

The following structure represents a complete local entity reference.

Structure: qsmm_lref_s

This structure holds the type of a local entity reference along with a local entity identifier. The structure contains the following fields.

Field: enum qsmm_lref_e type

The type of a local entity reference.

Field: union qsmm_lref_u val

The value of a local entity reference depending on its type. For the type QSMM_LREF_INVALID, must be a block of zero bytes.

A global entity reference identifies an entity in the address space of a running process. The error handler of a multinode model receives global references to entities related to errors. The type of a global entity reference specifies a method of identifying an entity. The following enumeration declares the types of global entity references.

Enumeration: qsmm_gref_e

This enumeration specifies a method of identification of an entity in the address space of a running process. The enumeration contains the following elements.

QSMM_GREF_INVALID

Invalid global entity reference, including the absence of an entity to identify.

QSMM_GREF_HANDLE_LREF

An object handle and a local entity reference. This method of identification is applicable to local entity references of QSMM_LREF_INSTR_CLASS_SET, QSMM_LREF_INSTR_META_CLASS, and QSMM_LREF_NODE types. The object handle has the type QSMM_HANDLE_MODEL and refers to a multinode model containing an instruction class set, instruction meta-class, or node.

QSMM_GREF_HANDLE_LREF2

An object handle, the local entity reference of a container, and the local entity reference of a contained entity. This method of identification is applicable to local entity references of QSMM_LREF_PROB_VAR_CTRL, QSMM_LREF_PROB_VAR_OUT, QSMM_LREF_PROB_ARR_OUT, and QSMM_LREF_INSTR_CLASS types for contained entities. The object handle has the type QSMM_HANDLE_MODEL and refers to a multinode model with the container. The local entity reference of the container has the type QSMM_LREF_NODE for a controlled probability variable, output probability variable, or output probabilities array contained in a node or the type QSMM_LREF_INSTR_CLASS_SET for an instruction class contained in an instruction class set.

The following union represents a global entity identifier for a global entity reference.

Union: qsmm_gref_u

This union holds a global entity identifier for a global entity reference with the type specified by an element of qsmm_gref_e enumeration. The union contains the following fields.

Field: struct qsmm_handle_lref_s handle_lref

An object handle and a local entity reference. This field is for a global entity reference of QSMM_GREF_HANDLE_LREF type.

Field: struct qsmm_handle_lref2_s handle_lref2

An object handle, the local entity reference of a container, and the local entity reference of a contained entity. This field is for a global entity reference of QSMM_GREF_HANDLE_LREF2 type.

The following structure holds an object handle and local entity reference in the field handle_lref of qsmm_gref_u union for global entity references of QSMM_GREF_HANDLE_LREF type.

Structure: qsmm_handle_lref_s

This structure holds the handle of an object and a local entity reference for an entity contained in the object. The structure contains the following fields.

Field: struct qsmm_handle_s handle

The handle of a containing object. At present, can only be a handle of QSMM_HANDLE_MODEL type.

Field: struct qsmm_lref_s lref

A local entity reference for an entity contained in an object. At present, can be a local entity reference of QSMM_LREF_INSTR_CLASS_SET, QSMM_LREF_INSTR_META_CLASS, or QSMM_LREF_NODE type, where the containing object is a multinode model.

The following structure holds an object handle, the local entity reference of a container, and the local entity reference of a contained entity in the field handle_lref2 of qsmm_gref_u union for global entity references of QSMM_GREF_HANDLE_LREF2 type.

Structure: qsmm_handle_lref2_s

This structure holds the handle of an object, the local entity reference of a container in the object, and a local entity reference for an entity in the container. The structure contains the following fields.

Field: struct qsmm_handle_s handle

The handle of an object. At present, can only be a handle of QSMM_HANDLE_MODEL type.

Field: struct qsmm_lref_s container

The local entity reference of a container in an object. At present, can be a local entity reference of QSMM_LREF_NODE or QSMM_LREF_INSTR_CLASS_SET type, where the containing object is a multinode model.

Field: struct qsmm_lref_s lref

A local entity reference for an entity in a container. At present, can be:

  • – a local entity reference of QSMM_LREF_PROB_VAR_CTRL, QSMM_LREF_PROB_VAR_OUT, or QSMM_LREF_PROB_ARR_OUT type for the container specified by a local entity reference of QSMM_LREF_NODE type;
  • – a local entity reference of QSMM_LREF_INSTR_CLASS type for the container specified by a local entity reference of QSMM_LREF_INSTR_CLASS_SET type.

The following structure represents a complete global entity reference.

Structure: qsmm_gref_s

This structure holds the type of a global entity reference along with a global entity identifier. The structure contains the following fields.

Field: enum qsmm_gref_e type

The type of a global entity reference.

Field: union qsmm_gref_u val

The value of a global entity reference depending on its type. For the type QSMM_GREF_INVALID, must be a block of zero bytes.


Next: , Previous: , Up: Listing a Multinode Model   [Contents][Index]