Annotated Ada Reference Manual (Ada 202y Draft 1)Legal Information
Contents   Index   References   Search   Previous   Next 

H.4.1 Aspect No_Controlled_Parts

Static Semantics

1/5
{AI12-0256-1} {AI12-0403-1} For a type, the following type-related, operational aspect may be specified:
2/5
No_Controlled_Parts

The type of this aspect is Boolean. If True, the type and any descendants shall not have any controlled parts. If specified, the value of the expression shall be static. If not specified, the value of this aspect is False.
2.a/5
Aspect Description for No_Controlled_Parts: A specification that a type and its descendants do not have controlled parts.
3/5
{AI12-0256-1} The No_Controlled_Parts aspect is nonoverridable (see 13.1.1).
3.a/5
Discussion: {AI12-0407-1} Since this is a Boolean-valued aspect, the blanket restrictions defined by 13.1.1 apply to the specification of Boolean-valued aspects on descendants of types with such aspects. But we still need rules about inheritance from progenitors and about hiding the aspect; it would be too painful to repeat those rules here (and have future maintenance fixes not get applied to this aspect). 

Legality Rules

4/5
{AI12-0256-1} {AI12-0407-1} If No_Controlled_Parts is True for a type, no component of the type shall have a controlled part nor shall the type itself be controlled. For the purposes of this rule, a type has a controlled part if its full type has a controlled part; this is applied recursively. In addition to the places where Legality Rules normally apply (see 12.3), this rule also applies in the private part of an instance of a generic unit.
4.a/5
Discussion: {AI12-0407-1} This check breaks privacy by looking at the full definition of all of the types involved. This is more like a representation aspect than an operational aspect, but representation aspects are not allowed on partial views and we need this aspect to be visible to clients. 
5/5
{AI12-0256-1} {AI12-0407-1} When enforcing the above rule within a generic body G or within the body of a generic unit declared within the declarative region of generic unit G, a generic formal private type of G and a generic formal derived type of G whose ancestor is a tagged type whose No_Controlled_Parts aspect is False are considered to have a controlled part.
5.a/5
Reason: This is a typical generic assume-the-worst rule. 
5.b/5
To be honest: {AI12-0407-1} If the ancestor of the generic derived type is class-wide, the aspect in question belongs to the specific type associated with the class-wide type. 

Extensions to Ada 2012

5.c/5
{AI12-0256-1} {AI12-0407-1} Aspect No_Controlled_Parts is new. 

Contents   Index   References   Search   Previous   Next 
Ada-Europe Ada 2005 and 2012 Editions sponsored in part by Ada-Europe