18.10.2014 Views

Object-oriented Software in Ada 95

Object-oriented Software in Ada 95

Object-oriented Software in Ada 95

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Appendix C: Library functions and packages<br />

The list of library functions and packages is reproduced from the <strong>Ada</strong> <strong>95</strong> Reference Manual ANSI/ISO/IEC-<br />

8652:19<strong>95</strong>. The follow<strong>in</strong>g copyright notice appears <strong>in</strong> the manual:<br />

Copyright © 1992,1993,1994,19<strong>95</strong> Intermetrics, Inc.<br />

This copyright is assigned to the U.S. Government. All rights reserved.<br />

This document may be copied, <strong>in</strong> whole or <strong>in</strong> part, <strong>in</strong> any form or by any means, as is or with alterations, provided<br />

that (1) alterations are clearly marked as alterations and (2) this copyright notice is <strong>in</strong>cluded unmodified <strong>in</strong> any<br />

copy. Compiled copies of standard library units and examples need not conta<strong>in</strong> this copyright notice so long as<br />

the notice is <strong>in</strong>cluded <strong>in</strong> all copies of source code and documentation.<br />

In reproduc<strong>in</strong>g the subset of the library functions and packages <strong>in</strong> the <strong>Ada</strong> library, the author has made<br />

changes to layout, case, and font. This was accomplished by us<strong>in</strong>g various software tools and so m<strong>in</strong>or changes<br />

may have been <strong>in</strong>troduced without the author's knowledge.<br />

C.1 Generic function Unchecked_Conversion<br />

The generic function Unchecked_Conversion performs a conversion between two dissimilar types. The size<br />

of the storage occupied by an <strong>in</strong>stance of the types must be the same.<br />

generic<br />

type Source() is limited private;<br />

type Target() is limited private;<br />

function <strong>Ada</strong>.Unchecked_Conversion(S : Source) return Target;<br />

pragma Convention(Intr<strong>in</strong>sic, <strong>Ada</strong>.Unchecked_Conversion);<br />

pragma Pure(<strong>Ada</strong>.Unchecked_Conversion);<br />

C.2 Generic function Unchecked_Deallocation<br />

The generic function Unchecked_Deallocation releases storage for storage claimed by an allocator back to<br />

the pool of free storage.<br />

generic<br />

type <strong>Object</strong>() is limited private;<br />

type Name is access <strong>Object</strong>;<br />

procedure <strong>Ada</strong>.Unchecked_Deallocation(X : <strong>in</strong> out Name);<br />

pragma Convention(Intr<strong>in</strong>sic, <strong>Ada</strong>.Unchecked_Deallocation);<br />

pragma Preelaborate(<strong>Ada</strong>.Unchecked_Deallocation);<br />

C.4 The Package Standard<br />

© M A Smith - May not be reproduced without permission

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!