Basic Structure
The basic structure of a SIDL file is illustrated below.
package <identifier> [version <version>]
{
interface <identifier> [ <inheritance> ]
{
[<type>] <identifier> ( [<parameters>] ) [throws <exception>];
.
.
.
[<type>] <identifier> ( [<parameters>] ) [throws <exception>];
}
class <identifier> [ <inheritance> ]
{
[<type>] <identifier> (<parameters>) [throws <exception>];
.
.
.
[<type>] <identifier> ( [<parameters>] ) [throws <exception>];
}
package <identifier> [version <version>]
{
.
.
.
}
}
The main elements are packages, interfaces, classes,
methods, and types. For a more detailed description, refer to
Appendix B.
- Packages
- provide a mechanism for specifying name space hierarchies.
That is, it enables grouping sets of interface and/or class descriptions as
well as nested packages. Identified by the package keyword, packages
have a scoped name that consists of one or more identifiers, or name
strings, separated by a period ("."). A package can contain multiple
interfaces, classes and nested packages. By default, packages are now
re-entrant. In order to make them non-re-entrant, they must be declared as
final.
- Interfaces
- define a set of methods that a caller can invoke on an
object of a class that implements the methods. Multiple inheritance of
interfaces is supported, which means an interface or a class can be derived from one
or more interfaces.
- Classes
- also define a set of methods that a caller can invoke on an
object. A class can extend only one other class but it can implement multiple
interfaces. So we have single inheritance of classes and multiple inheritance
of interfaces.
- Methods
- define services
that are available for invocation by a caller. The signature of the
method consists of the return type, identifier, arguments, and
exceptions. Each parameter has a type and a
mode. The mode indicates whether the value
of the specified type is passed from caller to callee
(in), from callee to caller (out),
or both (inout). Each exception that a method can
throw when it detects an error must be listed.
These exceptions can be either interfaces or classes so long as they
inherit from
sidl.BaseException.
For a default implementation of the exception interfaces, the
exception classes should extend
sidl.SIDLException.
Methods and parameter passing modes are discussed in greater detail in
Section 5.6.
- Types
- are used to constrain the the values of parameters, exceptions,
and return values associated with methods. SIDL supports basic types such as
int, bool, and long as well as strings, complex numbers,
and arrays.
babel-0.10.2
users_guide Last Modified 2005-03-23
http://www.llnl.gov/CASC/components
components@llnl.gov