TOC PREV NEXT INDEX DOC LIST MASTER INDEX




Function All_Named_Components

Expanded Name Asis.Data_Decomposition.All_Named_Components

Returns a list of all nonimplementation-defined discriminant and component entity name definitions from the specified record type definition.

Description

The string of the name can be obtained with the Expressions-.Name function.

The returned list does not include implementation-defined components (Ada83 LRM 13.4(8), Ada95 LRM 13.5.1). You can obtain those components with the Record_Components function.

Refer to the Appendix F for your compilation system to determine whether your compiler generates implementation-defined components.

Parameters

Specifies the type definition to be queried. The type definition must be of the following kinds:
Element_Kinds
Declaration_Kinds
A_Type_Definition
A_Derived_Type_Definition1
A_Record_Type_Definition
1 Of a record type definition.

All type-definition model kinds are appropriate.

The returned list contains elements of the following kinds:
Element_Kinds
Expression_Kinds
An_Entity_Name_Definition
A_Simple_Name

Errors

Asis_Inappropriate_Element is raised and Environment.Status is set to Value_Error if a parameter references a library variable that is no longer open or a parameter is specified that is not appropriate for the query.

Examples

Cross-References

Related subprograms:

Related concepts:


Type Array_Component

Expanded Name Asis.Data_Decomposition.Array_Component

Describes the components of an array-valued field for a record type.

Description

An array type describes composite values that contain 0 or more indexed elements. In ASIS, such types are represented by an element with an Element_Kinds of An_Array_Type_Definition or A_Derived_Type_Definition whose parent type is an array type. For purposes of data decomposition, the Array_Component type (referred to as an array component) describes an array type.

Array-Component Properties

The equality operator (=) is not meaningful between array component values, and should not be used unless one component is equal to Nil_Array_Component. Uninitialized array component variables are equal to Nil_Array_Component. Use the Is_Equal and Is_Identical functions to compare component values.

Array components become invalid, and result in an exception being raised if they are used, when the library containing the type definition they were derived from is closed.

Obtaining an Array's Components

If the array component is a composite, the array component and its associated stream can be further decomposed. If the component is not composite, you can use the methods described below to obtain an element or runtime data about an element.

Two methods are available to decompose composite array components and obtain the constituent record components or array component:

Both methods return the same value.

Unlike record decomposition, which can return an entire array of constituent components, array-component decomposition returns only a single value.

Using Array Components to Obtain Data

An array component describes an entire array. Given an array component, you can:

Unlike record components, you cannot decompose an array component to the point where the component represents an individual element in the array. To access an individual element or obtain runtime representation data for an element, you must either:

By specifying an iterator or the array component with either kind of index value, you can:

See "Accessing Array Elements" for more details.

Cross-References

Related resources:

Related concepts:


Type Array_Component_Iterator

Expanded Name Asis.Data_Decomposition.Array_Component_Iterator

Defines a type that allows iteration over successive components of an array.

Description

Iterators can be copied. The copies contain separate data and operate independently.

Iterators are one way of accessing the individual components of arrays. You can also use dimensional index values or linear index values.

Cross-References

Related subprograms and types:

Related concept:


Type Array_Component_List

Expanded Name Asis.Data_Decomposition.Array_Component_List

Defines a list of array components.

Description

An array component list is nil if the value of its 'Length attribute
is 0.

The type is not used by the ASIS interfaces and is provided only for completeness.

Cross-References

Related type:


Function Array_Components

Expanded Name Asis.Data_Decomposition.Array_Components

Returns a component describing all components of the specified array component or type definition.

Description

The returned value contains all information necessary to index to, and extract, any value from a data stream representing a value of the indicated type.

All returned values are valid parameters for all functions.

Parameters

Specifies the component to query. All components with an array subtype (Is_Array = True) are appropriate and must be of the following type-definition model kinds:
Type_Model_Kinds
A_Simple_Dynamic_Model
A_Simple_Static_Model

Specifies the array type definition to be queried. The type definition must be of the following kinds:
Element_Kinds
Type_Definition_Kinds
A_Type_Definition
A_Derived_Type_Definition1
An_Array_Type_Definition
1 Whose parent type is an array type.

Returns a component describing all components of the specified array component or type definition.

Errors

Asis_Inappropriate_Element is raised and Environment.Status is set to Value_Error if a parameter references a library variable that is no longer open or a parameter is specified that is not appropriate for the query.

Examples

Cross-References

Related subprograms:

Related concept:


Function Array_Index

Expanded Name Asis.Data_Decomposition.Array_Index

Returns a value that represents the current component in the array referenced by the specified iterator.

Description

The value returned represents the current linear index into the array referenced by the specified iterator.

Parameters

Specifies the iterator to query.

Returns a value that represents the current component in the array referenced by the specified iterator.

Errors

Asis_Inappropriate_Element is raised and Environment.Status is set to Value_Error if a parameter references a library variable that is no longer open or a parameter is specified that is not appropriate for the query.

Asis_Inappropriate_Element is raised and Environment.Status is set to Data_Error if a Nil iterator is specified or the iterator has completed (Done is True).

Examples

Cross-References

Related subprograms:

Related concept:


Function Array_Indexes

Expanded Name Asis.Data_Decomposition.Array_Indexes

Returns an array containing the current offset for each dimension, and representing the current component, in the array referenced by the specified iterator.

Description

The array returned represents the current dimensional index into the array referenced by the specified iterator.

Each element in the returned value represents a dimension in the array referenced by the specified iterator. Each value in the array has a range of 1 .. 'Length (Dimension).

During iteration, the last dimension index changes quickest. This is usually referred to as row-major ordering.

Parameters

Specifies the iterator to query.

Returns an array that represents the current component in the array referenced by the specified iterator.

Errors

Asis_Inappropriate_Element is raised and Environment.Status is set to Value_Error if a parameter references a library variable that is no longer open or a parameter is specified that is not appropriate for the query.

Asis_Inappropriate_Element is raised and Environment.Status is set to Data_Error if a Nil iterator is specified or the iterator has completed (Done is True).

Examples

Cross-References

Related subprograms and types:

Related concept:


Function Array_Iterator

Expanded Name Asis.Data_Decomposition.Array_Iterator

Returns an iterator referencing the first component of an array.

Description

The Done function should be used to determine whether the iteration has completed.

If the array component references a nil array, the Done function immediately returns True.

Parameters

Specifies the array component to be iterated over.

Returns an iterator referencing the first component of an array.

Errors

Asis_Inappropriate_Library is raised and Environment.Status is set to Value_Error if a parameter references a library that is no longer open.

Examples

Cross-References

Related subprograms:

Related concept:


Function Array_Length

Expanded Name Asis.Data_Decomposition.Array_Length

For the first two forms, returns the product of the 'Length attribute values for all dimensions of the specified component. For the last two forms, returns the 'Length attribute value for the specified dimension of the specified component.

Description

One way to determine the dimensionality of an array component is to construct an iterator for the component and then to use the Array_Indexes function to return a Dimension_Indexes array. The value of the 'Length attribute on the Dimension_Indexes array is the dimensionality.

Parameters

Specifies the component to query. All components with an array subtype (Is_Array = True) are appropriate.

Specifies the array dimension to query. The value must be between 1 and the number of dimensions specified for the array.

For the first form, returns the product of the 'Length attribute values for all dimensions of the specified component. For the second form, returns the 'Length attribute value for the specified dimension of the specified component.

Errors

Asis_Inappropriate_Element is raised and Environment.Status is set to Value_Error if a parameter references a library variable that is no longer open or a parameter is specified that is not appropriate for the query.

Examples

Cross-References

Related subprograms:

Related concept:


Function Component_Data_Stream

Expanded Name Asis.Data_Decomposition.Component_Data_Stream

Returns a data stream representing the specified component.

Description

The data stream representing the desired component is sliced from the specified data stream and returned.

The data stream could have been obtained from a file, extracted from another data stream, or artificially created with the Construct_Artificial_Data_Stream function. The data stream must represent a value of the appropriate type.

An attempt to extract anything other than constraint values from an artificial data stream causes Asis_Inappropriate_Element to be raised. Only the constraint values are valid in, and can be extracted from, an artificially created data stream.

Parameters

Specifies the component to query. All non-nil component values are appropriate.

Specifies the linear index value for the array component that is being queried. The value must be in the range 1 .. Array_Length (Component).

Specifies the dimensional index values for the array component that is being queried. There must be one value for each dimension of the array type, and the value must be in the range 1 .. Array_Length (Component, N), where N represents the dimension of interest.

Specifies the array component to query.

Specifies the data stream from which the data should be extracted.

Returns a data stream representing the specified component.

Errors

Asis_Inappropriate_Element is raised and Environment.Status is set to Value_Error if a parameter references a library variable that is no longer open or a parameter is specified that is not appropriate for the query.

Asis_Inappropriate_Element is raised and Environment.Status is set to Data_Error if a nil iterator is specified or the iterator has completed (Done is True).

Asis_Inappropriate_Element is raised and Environment.Status is set to Value_Error if an attempt is made to extract anything but constraint values from an artificially created data stream.

Examples

Cross-References

Related subprograms:

Related concept:


Function Component_Declaration

Expanded Name Asis.Data_Decomposition.Component_Declaration

Returns the declaration of the specified component.

Description

The declaration returned can be that of an explicit declaration (one that appears in the source code) or an implicit component declaration of an implementation-defined component (Ada83 LRM 13.4(8), Ada95 LRM 13.5.1).

Once the declaration of the component is obtained, you can use the functions in package Declarations and then Type_Definitions to determine the component's subtype, type, and base type.

Parameters

Specifies the component for which the declaration is desired. All non-nil components are appropriate.

The returned element is of the following kinds:
Element_Kinds
Declaration_Kinds
A_Declaration
A_Component_Declaration
A_Discriminant_Specification

Errors

Asis_Inappropriate_Element is raised and Environment.Status is set to Value_Error if a parameter references a library variable that is no longer open or a parameter is specified that is not appropriate for the query.

Examples

Cross-References

Related subprograms:

Related concepts:


Function Component_Indication

Expanded Name Asis.Data_Decomposition.Component_Indication

Returns the subtype indication for the specified component.

Description

You can use the functions in the package Type_Definitions to determine component's the subtype, type, and base type.

Parameters

Specifies the component for which the declaration is desired. All non-nil components are appropriate.

The returned element is of the following kind:
Element_Kinds

A_Subtype_Indication

Errors

Asis_Inappropriate_Element is raised and Environment.Status is set to Value_Error if a parameter references a library variable that is no longer open or a parameter is specified that is not appropriate for the query.

Examples

Cross-References

Related subprograms:

Related concepts:


Rational Software Corporation  http://www.rational.com
support@rational.com
techpubs@rational.com
Copyright © 1993-2001, Rational Software Corporation. All rights reserved.
TOC PREV NEXT INDEX DOC LIST MASTER INDEX TECHNOTES APEX TIPS