Ada 编程/属性/'访问
外观
X'Access 是一个 Ada 属性,其中 X 是任何对象或子程序。
'Access 可用于返回一个 访问 值,该值指定了对象或子程序。
type
General_Pointeris
access
all
Integer;type
Constant_Pointeris
access
constant
Integer; I1:aliased
constant
Integer := 10; I2:aliased
Integer; P1: General_Pointer := I1'Access; -- illegal P2: Constant_Pointer := I1'Access; -- OK, read only P3: General_Pointer := I2'Access; -- OK, read and write P4: Constant_Pointer := I2'Access; -- OK, read only P5:constant
General_Pointer := I2'Access; -- read and write only to I2
type
Callback_Procedureis
access
procedure
(Id : Integer; Text: String);procedure
Process_Event (Id : Integer; Text: String); My_Callback: Callback_Procedure := Process_Event'Access;