next up previous top
Next: Pipe
Up: Connector Type
Previous: DataAccess

FileIO

Semantics

The connector type FileIO provides an architectural abstraction for reading and writing from and to a sequential file. In a read operation, records are read sequentially starting from the beginning of the file. In a write operation, records are written sequentially to the end of the file. In addition to making this type of connection first-class (i.e., visible as an entity at the architecture description level), the FileIO connector type supports type-checking of the players in the connection on the basis of signatures and record formats as well as the spelling of the names (the signatures of the players playing the Reader/Writer roles are checked against the RecordFormat of the sequential file in which the Readee/Writee players are defined).

The system designer may use the IOMode property in the protocol property list to constrain the behavior of the FileIO connector to readonly, readwrite, or writeonly operations.

Role types

Roles of the following types can be legally defined in the protocol of a connector of type FileIO:

records to be read from a sequential file
a reader of records from a sequential file
records to be written to a sequential file
a writer of records to a sequential file

Properties

The following properties can be legally included in the property list of a connector of type FileIO. Properties legal in a <protocol> property list have a P in parentheses after the property name; those legal in an <instantiation> or <establish> property list have an I:

The syntax for an InstFormals property in a connector of type FileIO is a comma-separated list of <parameter>s enclosed in parentheses. A <parameter> consists of an <identifier>, followed by a `=', followed by a <complex string> or the language keyword NODEFAULT. A <complex string> is a simple "string" or a sequence of "string"s concatenated by the `&' character:

INSTFORMALS (first_parameter = "an initial value",
second_parameter = "a much" &
"longer initial value that " &
"will not fit on one line",
third_parameter = NODEFAULT)
The syntax for an IOMode property in a connector of type FileIO is one of the three keywords ReadOnly, ReadWrite, or WriteOnly, (optionally) enclosed in double-quotes, and surrounded by parentheses:

IOMODE (readonly)
IOMODE ("readwrite")
IOMODE ("writeonly")

If no IOMode property is specified in the protocol property list of a FileIO connector, the default value is "readwrite".

Semantic Checks

The following are the semantic checks made on connector definitions of type FileIO:

  1. If the IOMode of the FileIO connector is "readonly", then roles of types Readee and Reader must be defined in the protocol of the connector, and roles of types Writee and Writer must not be defined.

  2. If the IOMode of the FileIO connector is "readwrite", then roles of types Readee, Reader, Writee, and Writer must be defined in the protocol of the connector.

  3. If the IOMode of the FileIO connector is "writeonly", then roles of types Writee and Writer must be defined in the protocol of the connector, and roles of types Readee and Reader must not be defined.

The following are the semantic checks on connections made with FileIO connectors:

  1. The name of a player playing the Reader role must be identical (including case) to the name of the player playing the Readee role.

  2. The name of a player playing the Writer role must be identical (including case) to the name of the player playing the Writee role.

  3. The number of arguments and the data types of the arguments in the signature of the player playing the Reader role must be identical (including case of identifiers) to the number of elements and the data types of the elements in the
    RecordFormat property of the SeqFile component in which the player playing the Readee role is defined. (Warning only)

  4. The number of arguments and the data types of the arguments in the signature of the player playing the Writer role must be identical (including case of identifiers) to the number of elements and the data types of the elements in the
    RecordFormat property of the Seqfile component in which the player playing the Writee role is defined. (Warning only)

Implementation Semantics

FileIO connections are realized as linker directives that describe how (1) references to global data and (2) calls to input/output library routines and operating system services in the underlying system implementation are to be resolved with the addresses of the corresponding global data and routine definitions within a single address space. Recall that players associated with the Readee and Writee role types have no correspondence in the implementation of a system, and that those associated with the Reader and Writer role types are implemented as sequences of system calls to open, close, read, and write.


next up previous top
Next: Pipe
Up: Connector Type
Previous: DataAccess

Comments? Mail the current maintainer of this page.

Author: Gregory Zelesnik

Last Modified: May 12, 1996