| User's Guide: A Framework for Object Persistency for GNAT; Version 0.6.1; Document Revision $Revision: 1.17 $ | ||
|---|---|---|
| Prev | Chapter 32. UTIL.List | Next |
type Item_Type is private;
function List return Handle;
Create a list.
Postconditions:
The function returns a list handle.
Notes:
procedure Destroy(
This : in out Handle );
Destroy the list
C.1 - The list handle is valid.
All allocated resources are returned.
Notes:
procedure Append(
This : in Handle;
Item : in Item_Type;
Sub : in Handle := Null_Handle );
Append an element to the given list handle
C.1 - The list Handle has to be valid.
Exceptions:
function Length(
This : in Handle ) return Natural;
Get the length of the list
- C.1 List is valid.
- P.1 Nothing changed
- P.2 Returns the length of the list. If the list is empty a 0
is returned.
Notes:
procedure Execute(
It : in out Iterator;
Element : in out Item_Type ) is abstract;
procedure Execute(
This : in Handle;
It : in out Iterator'Class );
procedure Stop(
It : in out Iterator'Class );
type List_Reader_Handle is private;
Null_List_Reader_Handle : constant List_Reader_Handle ;
Append an element to the given list handle
Postconditions:
Notes:
function List_Reader(
This : in Handle ) return List_Reader_Handle;
Create a list reader for the given list
C.1 - List is valid
P.1 - The list reader points to the begin of the list.
Notes:
In order to loop through a list, use the First function to obtain the first element in the list.
procedure Destroy(
Reader : in out List_Reader_Handle );
End_Of_List : exception ;
Invalid_List : exception ;
function Child (
Reader : in List_Reader_Handle ) return Handle;
procedure Child(
Reader : in List_Reader_Handle;
List : in Handle );
Dstroy the list reader
C.1 - Listreader is valid
P.1 - All allocated resources are deallocated.
Notes:
function First(
Reader : in List_Reader_Handle ) return Item_Type;
Set the reader on the first element
C.1 - Listreader is valid
P.1 - the function returns the first element
Notes:
function Next(
Reader : in List_Reader_Handle ) return Item_Type;
Set the reader on the first element
C.1 - Listreader is valid
P.1 - the function returns the first element
Notes:
procedure Append(
Reader : in List_Reader_Handle;
Data : in Item_Type );
Preconditions:
C.1 - Listreader is valid
P.1 - the function returns the first element
Notes:
function Current(
Reader : in List_Reader_Handle ) return Item_Type;
Get the item where the current readpoint points to.
C.1 - Listreader is valid
P.1 - Nothing is changed. P.2 - Current element is returned.
Notes:
function List_End (
Reader : in List_Reader_Handle ) return Boolean;
Check for list end
C.1 - Listreader is valid
P.1 - Returns true if end of list is reached, else false.
Notes: