![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Function Construct_Artificial_Data_Stream
function Construct_Artificial_Data_Stream (Type_Definition : in Asis.Type_Definition; Data_Stream : in Asis.Portable_Transfer.Portable_Data; Discriminant : in Record_Component; Value : in Asis.Portable_Transfer.Portable_Data) return Asis.Portable_Transfer.Portable_Data;Expanded Name Asis.Data_Decomposition.Construct_Artificial_Data_Stream
Returns an artificial data stream that represents the specified type definition and has been updated with the specified value for the specified discriminant.
Description
To complete the construction of the artificial data stream, the function must be called once for each discriminant. The return value of each call should be used as the input data-stream value for the next call. The initial call specifies a nil data stream; this directs the function to initialize the stream before installing the first discriminant value.
The order in which the discriminants are specified is not
significant.The resulting artificial data stream contains only valid discriminant values. The values of all other record components are undefined.
The sole use of the artificial data stream is to obtain record component values (with the Record_Components functions). The component values for all discriminants and components can be obtained. With the component values, you can obtain the first bit, last bit, position, and size attribute values of the discriminants and components.
Parameters
Type_Definition : in Asis.Type_Definition;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
A_Record_Type_Definition
1 Whose parent type is a record type.
And of the following type-definition model kinds:
Type_Model_Kinds
A_Simple_Dynamic_Model
A_Simple_Static_Model
Parameters (continued)
Data_Stream : in Asis. Portable_Transfer.Portable_Data;Specifies the data stream that has been constructed thus far. The initial value should be Nil_Portable_Data.
Discriminant : in Record_Component;Specifies the discriminant of the record, referenced by the type definition, that is being set or changed.
Value : in Asis. Portable_Transfer.Portable_Data;Specifies a value of the appropriate type for the specified discriminant.
return Asis.Portable_Transfer.Portable_Data;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 the discriminant value is not appropriate for the specified discriminant.
Examples
Cross-References
Type Dimension_Indexes
type Dimension_Indexes is array (Asis.Asis_Positive range <>) of Asis.Asis_Positive;Expanded Name Asis.Data_Decomposition.Dimension_Indexes
Defines an array of index values used to reference an array stream.
Description
Each element in the type represents a dimension in an array.
Each element has a range of 1 .. 'Length (Dimension) of the array it describes. The 'First and 'Last values are not used because the original index type might have been an enumeration type and the type might not be available to the program using this interface.
Cross-References
- function Array_Indexes
- function Component_Data_Stream
- function First_Bit
- function Last_Bit
- function Position
Function Discriminant_Components
function Discriminant_Components (Component : in Array_Component) return Record_Component_List;
function Discriminant_Components (Component : in Record_Component) return Record_Component_List;
function Discriminant_Components (Type_Definition : in Asis.Type_Definition) return Record_Component_List;Expanded Name Asis.Data_Decomposition.Discriminant_Components
Returns a list containing the discriminants of the specified array component, record component, or record type definition.
Description
The returned components can be used with a data stream representing a value of the specified record type.
All returned values are valid parameters for all functions.
Parameters
Component : in Array_Component;Component : in Record_Component;Specifies the component to query. All components with a record subtype (Is_Record = True) and all type-definition model kinds are appropriate.
Type_Definition : in Asis.Type_Definition;Specifies the record 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
A_Record_Type_Definition
1 Whose parent type is a record type.
All type-definition model kinds are appropriate.
return Record_Component_List;Returns a list containing the discriminants of the specified or referenced record type.
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
Function Done
function Done (Iterator : in Array_Component_Iterator) return Boolean;Expanded Name Asis.Data_Decomposition.Done
Returns a Boolean value indicating whether the specified iterator is past the last array component.
Description
If Nil_Array_Component_Iterator is specified, True is returned.
Parameters
Iterator : in Array_Component_Iterator;Specifies the iterator to query.
return Boolean;Returns True if the specified iterator is past the last array component.
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
Function First_Bit
function First_Bit (Component : in Record_Component) return Asis.Asis_Natural;
function First_Bit (Component : in Array_Component; Index : in Asis.Asis_Positive) return Asis.Asis_Natural;
function First_Bit (Component : in Array_Component; Indexes : in Dimension_Indexes) return Asis.Asis_Natural;
function First_Bit (Iterator : in Array_Component_Iterator) return Asis.Asis_Natural;Expanded Name Asis.Data_Decomposition.First_Bit
For the first form, returns the offset, from the start of the first of the storage units occupied by the specified component, of the first bit occupied by the specified component.
For the last three forms, returns the offset, from the start of the first of the storage units occupied by the specified component, of the first bit occupied by the element referenced.
Description
The offset is measured in bits.
This function is meant to reflect the value of the 'First_Bit predefined language attribute (LRM Annex A).
Parameters
Component : in Array_Component;Component : in Record_Component;Specifies the component to query. All non-nil component values are appropriate.
Index : in Asis.Asis_Positive;Specifies the linear index value for the array component that is being queried. The value must be in the range 1 .. Array_Length (Component).
Indexes : in Dimension_Indexes;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.
Iterator : in Array_Component_Iterator;Specifies the array component to query.
return Asis.Asis_Natural;Returns the offset, from the start of the first of the storage units occupied by the specified component, of the first bit occupied by 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 any index is not in the expected range or if Done (Iterator) is True.
Examples
Cross-References
Related subprograms and types:
- type Array_Component
- function Array_Indexes
- function Array_Iterator
- function Array_Length
- function Last_Bit
- function Position
- function Size
Function Is_Array
function Is_Array (Component : in Array_Component) return Boolean;
function Is_Array (Component : in Record_Component) return Boolean;Expanded Name Asis.Data_Decomposition.Is_Array
Returns a Boolean value indicating whether the specified component has an array subtype.
Description
If a nil component is specified, False is returned.
Parameters
Component : in Array_Component;Component : in Record_Component;Specifies the component to be queried.
return Boolean;Returns True if the specified component has an array subtype.
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 and constants:
Function Is_Equal
function Is_Equal (Left : in Array_Component; Right : in Array_Component) return Boolean;
function Is_Equal (Left : in Record_Component; Right : in Record_Component) return Boolean;Expanded Name Asis.Data_Decomposition.Is_Equal
Returns a Boolean value indicating whether the specified components represent the same component, of the same record or array type, from the same physical compilation unit.
Description
To be from the same physical compilation unit, the Compilation-_Units.Enclosing_Compilation_Unit for the Component_Declaration values must be Compilation_Units.Is_Equal.
The two components need not have been derived from the same library.
The function also returns True if both parameters represent nil components.
Parameters
Left : in Array_Component;Left : in Record_Component;Specifies the first component. All component values are appropriate.
Right : in Array_Component;Right : in Record_Component;Specifies the second component. All component values are appropriate.
return Boolean;Returns True if the specified components represent the same component, of the same record or array type, from the same physical compilation unit.
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 and constants:
Function Is_Identical
function Is_Identical (Left : in Array_Component; Right : in Array_Component) return Boolean;
function Is_Identical (Left : in Record_Component; Right : in Record_Component) return Boolean;Expanded Name Asis.Data_Decomposition.Is_Identical
Returns a Boolean value indicating whether the specified components represent the same component, of the same record or array type, from the same physical compilation unit, from the same library.
Description
To be from the same physical compilation unit, the Compilation-_Units.Enclosing_Compilation_Unit for the Component_Declaration values must be Compilation_Units.Is_Identical.
The function also returns True if both parameters represent nil components.
Parameters
Left : in Array_Component;Left : in Record_Component;Specifies the first component. All component values are appropriate.
Right : in Array_Component;Right : in Record_Component;Specifies the second component. All component values are appropriate.
return Boolean;Returns True if the specified components represent the same component, of the same record or array type, from the same physical compilation unit, from the same library.
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 and constants:
Function Is_Nil
function Is_Nil (Right : in Array_Component) return Boolean;
function Is_Nil (Right : in Record_Component) return Boolean;Expanded Name Asis.Data_Decomposition.Is_Nil
Returns a Boolean value indicating whether the specified component is a nil component.
Description
An array component is nil if its value is Nil_Array_Component.
A record component is nil if its value is Nil_Record_Component.
An uninitialized component tests as Is_Nil.
Parameters
Right : in Array_Component;Right : in Record_Component;Specifies the component to query.
return Boolean;Returns True if the specified component's value is the appropriate nil value.
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 and constants:
Function Is_Record
function Is_Record (Component : in Array_Component) return Boolean;
function Is_Record (Component : in Record_Component) return Boolean;Expanded Name Asis.Data_Decomposition.Is_Record
Returns a Boolean value indicating whether the specified component has a record subtype.
Description
If a nil component is specified, False is returned.
Parameters
Component : in Array_Component;Component : in Record_Component;Specifies the component to be queried.
return Boolean;Returns True if the specified component has a record subtype.
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 and constants:
Function Last_Bit
function Last_Bit (Component : in Array_Component; Indexes : in Dimension_Indexes) return Asis.Asis_Natural;
function Last_Bit (Iterator : in Array_Component_Iterator) return Asis.Asis_Natural;
function Last_Bit (Component : in Array_Component; Index : in Asis.Asis_Positive) return Asis.Asis_Natural;
function Last_Bit (Component : in Record_Component) return Asis.Asis_Natural;Expanded Name Asis.Data_Decomposition.Last_Bit
For the first form, returns the offset, from the start of the first of the storage units occupied by the specified component, of the last bit occupied by the specified component.
For the last three forms, returns the offset, from the start of the first of the storage units occupied by the specified component, of the last bit occupied by the element referenced.
Description
The offset is measured in bits.
This function is meant to reflect the value of the 'Last_Bit predefined language attribute (LRM Annex A).
Parameters
Component : in Array_Component;Component : in Record_Component;Specifies the component to query. All non-Nil component values are appropriate.
Index : in Asis.Asis_Positive;Specifies the linear index value for the array component that is being queried. The value must be in the range 1 .. Array_Length (Component).
Indexes : in Dimension_Indexes;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.
Iterator : in Array_Component_Iterator;Specifies the array component to query.
return Asis.Asis_Natural;Returns the offset, from the start of the first of the storage units occupied by the specified component, of the last bit occupied by 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 any index is not in the expected range or if Done (Iterator) is True.
Examples
Cross-References
Related subprograms and types:
- type Array_Component
- function Array_Indexes
- function Array_Iterator
- function Array_Length
- function First_Bit
- function Position
- function Size
Procedure Next
procedure Next (Iterator : in out Array_Component_Iterator);Expanded Name Asis.Data_Decomposition.Next
Advances the iterator to the next array component.
Description
If the iterator is already passed the last array component, the procedure does nothing.
Use the Done function to determine whether the iterator has passed the last array component.
Use the Reset function to reset the iterator to the first array component.
Parameters
Iterator : in out Array_Component_Iterator;Specifies the iterator to advance.
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
Rational Software Corporation
http://www.rational.com support@rational.com techpubs@rational.com Copyright © 1993-2001, Rational Software Corporation. All rights reserved. |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |