E.2.3 Remote Call Interface Library Units
A remote call interface library unit can be used 
as an interface for remote procedure calls (RPCs) (or remote function 
calls) between active partitions. 
Syntax
The 
form of a 
pragma 
Remote_Call_Interface is as follows: 
 
  pragma Remote_Call_Interface[(
library_unit_name)];
 
The form of a 
pragma 
All_Calls_Remote is as follows: 
 
  pragma All_Calls_Remote[(
library_unit_name)];
 
A 
pragma 
All_Calls_Remote is a library unit pragma. 
 
Legality Rules
A 
pragma Remote_Call_Interface 
is used to specify that a library unit is a 
remote call interface 
(RCI), namely that the Remote_Call_Interface aspect
 
of the library unit is True. A subprogram declared in the visible part 
of such a library unit, or declared by such a library unit, is called 
a 
remote subprogram.
 
The declaration of an RCI library unit shall be preelaborable 
(see 
10.2.1), and shall depend semantically 
only upon declared pure 
library_items, 
shared passive library units, remote types library units, other remote 
call interface library units, or preelaborated normal library units that 
are mentioned only in private with clauses.
 
In addition, the following 
restrictions apply to an RCI library unit: 
its visible part shall not contain the declaration 
of a variable; 
its visible part shall not contain the declaration 
of a limited type; 
it shall not be, nor shall its visible part contain, 
the declaration of a subprogram for which aspect Inline is True;
it shall not be, nor shall its visible part contain, 
a subprogram (or access-to-subprogram) declaration whose profile has 
a parameter or result of a type that does not support external streaming 
(see 
13.13.2);
 
any public child of the library unit shall be a 
remote call interface library unit. 
 A pragma All_Calls_Remote sets the All_Calls_Remote 
representation aspect of 
the 
library unit to which the pragma applies to the value True. If the All_Calls_Remote 
aspect of a library unit is True, the library unit shall be a remote 
call interface.
 
Post-Compilation Rules
A remote call interface library unit shall be assigned 
to at most one partition of a given program. A remote call interface 
library unit whose parent is also an RCI library unit shall be assigned 
only to the same partition as its parent. 
Notwithstanding 
the rule given in 
10.2, a compilation unit 
in a given partition that semantically depends on the declaration of 
an RCI library unit, 
needs (in the sense of 
10.2) 
only the declaration of the RCI library unit, not the body, to be included 
in that same partition. Therefore, the body of an RCI library unit is 
included only in the partition to which the RCI library unit is explicitly 
assigned.
 
Implementation Requirements
 If aspect All_Calls_Remote 
is True for a given RCI library unit, then the implementation shall route 
any of the following calls through the Partition Communication Subsystem 
(PCS); see 
E.5: 
 
A direct call to a subprogram of the RCI unit from 
outside the declarative region of the unit;
An indirect call through a remote access-to-subprogram 
value that designates a subprogram of the RCI unit;
A dispatching call with a controlling operand designated 
by a remote access-to-class-wide value whose tag identifies a type declared 
in the RCI unit. 
Implementation Permissions
 An implementation need not support the Remote_Call_Interface 
pragma or aspect nor the All_Calls_Remote pragma. Explicit message-based 
communication between active partitions can be supported as an alternative 
to RPC. 
Ada 2005 and 2012 Editions sponsored in part by Ada-Europe