// cashier.h - the Cahier class, representing single cashiers at the supermarket
// (modifed from pump.h)

#ifndef _CASHIER_H
#define _CASHIER_H

#include "custqueue.h"
#include "cust.h"
#include <stdlib.h>

typedef enum typeCashier {express, regular};

class Cashier {
private:
   typeCashier type; 
   Cust *custInService;
   CustQueue cqueue;

   // serviceTime: determine how long the service will take
   //              depends on Customer-Cashier combination.
   // CODE: should change distribution for this method
   double serviceTime ();

public:
   
   Cashier(typeCashier cType = regular ) { type = cType; }

   void setType( typeCashier cType ) { type = cType; }

   CustQueue *getCustQueue() { return &cqueue; } 

   // getCustInService: return the customer currently being served by
   // the cashier.
   Cust *getCustInService () { return custInService; }

   int freeCashier() { return (custInService == NULL); }

   // startService: the start-of-service event routine.
   // Connects the customer to this cashier, and determines when 
   // the service will stop.
   void startService (Cust *cust);

   void endService () { custInService = NULL; }
  
};

#endif
