Spec-Zone.ru › Ada 2005
Ada 2005 Reference Manual

E.2.2 Remote Types Library Units

A remote types library unit supports the definition of types intended for use in communication between active partitions.

Syntax

The form of a pragma Remote_Types is as follows:
pragma Remote_Types[(library_unit_name)];

Legality Rules

A remote types library unit is a library unit to which the pragma Remote_Types applies. The following restrictions apply to the declaration of such a library unit:
  • it shall be preelaborable;
  • it shall depend semantically only on declared pure, shared passive, or other remote types library units;
  • it shall not contain the declaration of any variable within the visible part of the library unit;
  • the full view of each type declared in the visible part of the library unit that has any available stream attributes shall support external streaming (see 13.13.2).
An access type declared in the visible part of a remote types or remote call interface library unit is called a remote access type. Such a type shall be:
  • an access-to-subprogram type, or
  • a general access type that designates a class-wide limited private type or a class-wide private type extension all of whose ancestors are either private type extensions or limited private types.
A type that is derived from a remote access type is also a remote access type.
The following restrictions apply to the use of a remote access-to-subprogram type:
  • A value of a remote access-to-subprogram type shall be converted only to or from another (subtype-conformant) remote access-to-subprogram type;
  • The prefix of an Access attribute_reference that yields a value of a remote access-to-subprogram type shall statically denote a (subtype-conformant) remote subprogram.
The following restrictions apply to the use of a remote access-to-class-wide type:
  • The primitive subprograms of the corresponding specific limited private type shall only have access parameters if they are controlling formal parameters; each non-controlling formal parameter shall support external streaming (see 13.13.2);
  • A value of a remote access-to-class-wide type shall be explicitly converted only to another remote access-to-class-wide type;
  • A value of a remote access-to-class-wide type shall be dereferenced (or implicitly converted to an anonymous access type) only as part of a dispatching call where the value designates a controlling operand of the call (see E.4, “Remote Subprogram Calls”).
  • The Storage_Pool attribute is not defined for a remote access-to-class-wide type; the expected type for an allocator shall not be a remote access-to-class-wide type. A remote access-to-class-wide type shall not be an actual parameter for a generic formal access type. The Storage_Size attribute of a remote access-to-class-wide type yields 0; it is not allowed in an attribute_definition_clause.
NOTES
5 A remote types library unit need not be pure, and the types it defines may include levels of indirection implemented by using access types. User-specified Read and Write attributes (see 13.13.2) provide for sending values of such a type between active partitions, with Write marshalling the representation, and Read unmarshalling any levels of indirection.


Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API