
DEFINITION MODULE RES;

FROM STAT  IMPORT Block;
FROM LIST  IMPORT List;
FROM PROCS IMPORT ProcessInstance;

TYPE
   Resource;


   ServicePolicy = (Fifo, Lifo, Prior);


   UserDossier;


PROCEDURE Create
   ( VAR R    : Resource;
     Policy   : ServicePolicy;
     Capac    : CARDINAL;
     Name     : ARRAY OF CHAR
   );


PROCEDURE CollectStat
   ( R : Resource
   );


PROCEDURE InitStat
   ( R : Resource
   );


PROCEDURE Init
   ( R : Resource
   );


PROCEDURE ChangeCapacity
   ( R : Resource;
     N : INTEGER
   );


PROCEDURE SetCapacity
   ( R : Resource;
     N : CARDINAL
   );


PROCEDURE Avail
   ( R : Resource
   ) : CARDINAL;


PROCEDURE Request
   ( N : CARDINAL;
     R : Resource
   );


PROCEDURE RequestWithPrior
   ( N : CARDINAL;
     R : Resource;
     Pri : LONGREAL
   );


PROCEDURE Release
   ( N : CARDINAL;
     R : Resource
   );


PROCEDURE WaitList
  ( R : Resource
  ) : List;

                                                        
PROCEDURE ServList
  ( R : Resource
  ) : List;


PROCEDURE User
   ( U : UserDossier
   ) : ProcessInstance;


PROCEDURE NbUnits
   ( U : UserDossier
   ) : CARDINAL;


PROCEDURE StatCapacity
   ( R : Resource
   ) : Block;


PROCEDURE StatUtil
   ( R : Resource
   ) : Block;


PROCEDURE StatSojourn
   ( R : Resource
   ) : Block;


PROCEDURE Report
   ( R : Resource
   );


PROCEDURE Delete
   ( VAR R : Resource
   );


END RES.
