API Reference

Generic Package Parameter(s)

   type Item_Type is private; 
 

function List

   function List return Handle;  

Description

Create a list.

Preconditions

Postconditions:

The function returns a list handle.

Exceptions

Notes:

procedure Destroy

   procedure Destroy(  
      This : in out Handle ); 
 

Description

Destroy the list

Preconditions

C.1 - The list handle is valid.

Postconditions

All allocated resources are returned.

Exceptions

Notes:

procedure Append

   procedure Append(  
      This : in Handle; 
      Item : in Item_Type; 
      Sub  : in Handle := Null_Handle ); 
 

Description

Append an element to the given list handle

Preconditions

C.1 - The list Handle has to be valid.

Postconditions

Exceptions:

function Length

   function Length(  
      This : in Handle ) return Natural; 
 

Description

Get the length of the list

Preconditions

- C.1 List is valid.

Postconditions

- P.1 Nothing changed

- P.2 Returns the length of the list. If the list is empty a 0

is returned.

Exceptions

Notes:

procedure Execute, procedure Execute, procedure Stop, type List_Reader_Handle

   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 ; 
 

Description

Append an element to the given list handle

Preconditions

Postconditions:

Exceptions

Notes:

function List_Reader

   function List_Reader(  
      This : in Handle ) return List_Reader_Handle; 
 

Description

Create a list reader for the given list

Preconditions

C.1 - List is valid

Postconditions

P.1 - The list reader points to the begin of the list.

Exceptions

Notes:

In order to loop through a list, use the First function to obtain the first element in the list.

procedure Destroy, function Child , procedure Child

   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 ); 
 

Description

Dstroy the list reader

Preconditions

C.1 - Listreader is valid

Postconditions

P.1 - All allocated resources are deallocated.

Exceptions

Notes:

function First

   function First(  
      Reader : in List_Reader_Handle ) return Item_Type; 
 

Description

Set the reader on the first element

Preconditions

C.1 - Listreader is valid

Postconditions

P.1 - the function returns the first element

Exceptions

Notes:

function Next

   function Next(  
      Reader : in List_Reader_Handle ) return Item_Type; 
 

Description

Set the reader on the first element

Preconditions

C.1 - Listreader is valid

Postconditions

P.1 - the function returns the first element

Exceptions

Notes:

procedure Append

   procedure Append(  
      Reader : in List_Reader_Handle; 
      Data   : in Item_Type ); 
 

Description

Preconditions:

C.1 - Listreader is valid

Postconditions

P.1 - the function returns the first element

Exceptions

Notes:

function Current

   function Current(  
      Reader : in List_Reader_Handle ) return Item_Type; 
 

Description

Get the item where the current readpoint points to.

Preconditions

C.1 - Listreader is valid

Postconditions

P.1 - Nothing is changed. P.2 - Current element is returned.

Exceptions

Notes:

function List_End

   function List_End (  
      Reader : in List_Reader_Handle ) return Boolean; 
 

Description

Check for list end

Preconditions

C.1 - Listreader is valid

Postconditions

P.1 - Returns true if end of list is reached, else false.

Exceptions

Notes: