Jump to content

Ada Programming/Keywords/interface

From Wikibooks, open books for an open world

Ada. Time-tested, safe and secure.
Ada. Time-tested, safe and secure.

This language feature is only available from Ada 2005 on.

Used to declare an interface. Interfaces are the most important innovation in Ada 2005. The basic semantic has been taken from the interface concept of the Java programming language. Interface inheritance is a reduced form of multiple inheritance.

Interface types

[edit | edit source]

There are various forms of interfaces available:

Normal interface

[edit | edit source]

The normal interface is declared as:

type Printable isinterface; 

Limited interface

[edit | edit source]

Can be used as interface to limited tagged type.

type Printable islimitedinterface; 

Synchronized interface

[edit | edit source]
type Printable issynchronizedinterface; 

All synchronized interfaces are also limited.

Task interface

[edit | edit source]

Can be used as an interface to a task type.

type Printable istaskinterface; 

All task interfaces are also synchronized.

Protected interface

[edit | edit source]

Can be used as an interface to a protected type.

type Printable isprotectedinterface; 

All protected interfaces are also synchronized.

See also

[edit | edit source]

Wikibook

[edit | edit source]

Ada Reference Manual

[edit | edit source]

Ada 2005

[edit | edit source]

Ada Quality and Style Guide

[edit | edit source]


Ada Keywords
abortelsenewreturn
abselsifnotreverse
abstract (Ada 95) endnull
acceptentryselect
accessexceptionofseparate
aliased (Ada 95) exitorsome (Ada 2012)
allotherssubtype
andforoutsynchronized (Ada 2005)
arrayfunctionoverriding (Ada 2005)
attagged (Ada 95)
genericpackagetask
begingotoparallel (Ada 2022) terminate
bodypragmathen
ifprivatetype
caseinprocedure
constantinterface (Ada 2005) protected (Ada 95) until (Ada 95)
isuse
declareraise
delaylimitedrangewhen
deltalooprecordwhile
digitsremwith
domodrenames
requeue (Ada 95) xor
close