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.

xvi<br />

Actual<br />

parameter<br />

Preface<br />

The physical object passed to a function, procedure, entry or generic unit. For<br />

example, <strong>in</strong> the follow<strong>in</strong>g statement the actual parameter to the procedure Put<br />

is Number.<br />

Pr<strong>in</strong>t( Number );<br />

<strong>Ada</strong> 83<br />

The version of the language that conforms to ANSI/MIL-STD 1815A<br />

ISO/IEC 8652:1983, 1983. <strong>Ada</strong> 83 is superseded by <strong>Ada</strong> <strong>95</strong>. The language is<br />

named after <strong>Ada</strong> Augusta the Countess of Lovelace, daughter of the poet<br />

Lord Byron and Babbage's ‘programmer’.<br />

<strong>Ada</strong> <strong>95</strong> The version of the language that conforms to ANSI/ISO/IEC 8652:19<strong>95</strong>,<br />

January 19<strong>95</strong>. The ISO standard was published on 15th February 19<strong>95</strong>. <strong>Ada</strong><br />

<strong>95</strong> is now often referred to as <strong>Ada</strong><br />

<strong>Ada</strong> class<br />

Allocator<br />

In <strong>Ada</strong> the term<strong>in</strong>ology class is used to describe a set of types. To avoid<br />

confusion this will be termed an <strong>Ada</strong> class.<br />

An allocator is used to claim storage dynamically from a storage pool. For<br />

example, storage for an Integer is allocated dynamically with:<br />

P_Int := new Integer;<br />

Base class<br />

Class<br />

A class from which other classes are derived.<br />

The specification of a type and the operations that are performed on an<br />

<strong>in</strong>stance of the type. A class is used to create objects that share a common<br />

structure and behaviour.<br />

The specification of a class Account is as follows:<br />

package Class_Account is<br />

type Account is private;<br />

subtype Money is Float;<br />

function Balance ( The:<strong>in</strong> Account ) return Money;<br />

-- Other methods on an <strong>in</strong>stance of an Account<br />

private<br />

type Account is record<br />

Balance_Of : Money := 0.00; --Amount <strong>in</strong> account<br />

end record;<br />

end Class_Account;<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!