next up previous top
Next: Library
Up: Property
Previous: InstFormals

IOMode

Description

The IOMode property is used to further specify a FileIO connector definition. It specifies the input/output mode of the FileIO connector. Such a connector can be defined for readonly, readwrite, and writeonly interaction between components.

The specification of IOMode in a FileIO connector constrains the types of the roles that can be defined in the connector. Readonly FileIO connectors must define one role each of the types Readee and Reader. Readwrite connectors must define one role each of the following types: Readee, Reader, Writee, and Writer. Writeonly connectors must define one role each of the types Writee and Writer.

WARNING: The IOMode property can be specified in a connector instantiation, but this is not recommended because the role types are fixed in the connector definition, not the instantiation. The UniCon compiler will report the appropriate errors if the IOMode specification in the instantiation does not match the set of role types in the definition.

Property Lists

The IOMode property can legally be specified in the property list in the following UniCon language elements:

Value Syntax

The syntax of the value part of the IOMode property is one of the three keywords readonly, readwrite, or writeonly, optionally enclosed in double-quotes, surrounded by parentheses. The case of the letters can be upper, lower, or mixed.

Required Rule

Optional

The default value for the IOMode property is readwrite.

Merge Rule

REPLACE

Subsequent specifications of the IOMode property in a single property list replace earlier specifications (i.e., the last specification is the one that the UniCon compiler uses).

Semantic Checks

The following are the semantic checks performed on the value of the IOMode property:

  1. The value part of the IOMode property must be one of the three keywords
    readonly, readwrite, and writeonly.

  2. If the IOMode of the FileIO connector is readonly, then the connector must define exactly two roles: one of type Readee, and the other of type Reader.

  3. If the IOMode of the FileIO connector is readwrite, then the connector must define exactly four roles: one each of the types Readee, Reader, Writee, and Writer.

  4. If the IOMode of the FileIO connector is writeonly, then the connector must define exactly two roles: one of type Writee, and the other of type Writer.

Example

The following is an example of a specification of an IOMode property. It is embedded in the protocol of a FileIO connector:

  CONNECTOR Unix_FileIO
    PROTOCOL IS
      TYPE FileIO
      IOMODE (readonly)
      ROLE Readee IS Readee
      ROLE Reader IS Reader
    END PROTOCOL
    IMPLEMENTATION IS
      BUILTIN
    END IMPLEMENTATION
  END Unix_FileIO

next up previous top
Next: Library
Up: Property
Previous: InstFormals

Comments? Mail the current maintainer of this page.

Author: Gregory Zelesnik

Last Modified: May 12, 1996