Next: Pragma CPP_Vtable, Previous: Pragma CPP_Constructor, Up: Implementation Defined Pragmas
pragma CPP_Virtual [Entity =>] ENTITY, [, [Vtable_Ptr =>] vtable_ENTITY,] [, [Position =>] static_integer_EXPRESSION]);
This pragma serves the same function as pragma Import
in that
case of a virtual function imported from C++. The Entity argument
must be a
primitive subprogram of a tagged type to which pragma CPP_Class
applies. The Vtable_Ptr argument specifies
the Vtable_Ptr component which contains the
entry for this virtual function. The Position argument
is the sequential number
counting virtual functions for this Vtable starting at 1.
The Vtable_Ptr
and Position
arguments may be omitted if
there is one Vtable_Ptr present (single inheritance case) and all
virtual functions are imported. In that case the compiler can deduce both
these values.
No External_Name
or Link_Name
arguments are required for a
virtual function, since it is always accessed indirectly via the
appropriate Vtable entry.
Pragma CPP_Virtual
is intended primarily for automatic generation
using an automatic binding generator tool.
See Interfacing to C++ for related information.