12.2 Foreign Pointers

Module ForeignPointer provides an interface to encapsulated raw pointers to foreign data. This is useful for implementors of foreign libraries: any C pointer can be encapsulated as a ForeignPointer and passed around as an Oz value. However, you should consider subclassing the Oz_Extension class instead, to encapsulate your C++ data structures into new Oz (abstract) datatypes.


{ForeignPointer.is +X ?B}

tests whether X is a foreign pointer


{ForeignPointer.toInt +X ?I}

converts a foreign pointer to an integer. Two foreign pointers convert to the same integer iff they point to the same location.

Denys Duchier, Leif Kornstaedt and Christian Schulte
Version 1.4.0 (20080702)