

DEFINITION MODULE BIN;

FROM LIST  IMPORT List;
FROM PROCS IMPORT ProcessInstance;

TYPE

   Bin;


   ServicePolicy = (Fifo, Lifo, Prior);


   UserDossier;


PROCEDURE Create
   ( VAR B    : Bin;
     Policy   : ServicePolicy;
     Name     : ARRAY OF CHAR
   );


PROCEDURE Init
   ( B : Bin
   );


PROCEDURE Avail
   ( B : Bin
   ) : CARDINAL;


PROCEDURE Take
   ( N : CARDINAL;
     B : Bin
   );


PROCEDURE TakeWithPrior
   ( N : CARDINAL;
     B : Bin;
     Priority : LONGREAL
   );


PROCEDURE Give
   ( N : CARDINAL;
     B : Bin
   );


PROCEDURE WaitList
  ( B : Bin
  ) : List;


PROCEDURE User
   ( U : UserDossier
   ) : ProcessInstance;


PROCEDURE NbTokens
   ( U : UserDossier
   ) : CARDINAL;


PROCEDURE Delete
   ( VAR B : Bin
   );


END BIN.
