// cstand.h: the CashierStand class, represents the complete collection of
// cashiers at the supermarket with their customer lineups. 
// (modified from pstand.h)

#ifndef _CSTAND_H
#define _CSTAND_H

#include "custqueue.h"
#include "cashier.h"

class CashierStand {
private:
   Cashier* expressCashiers; // an array of express cashiers
   Cashier* regularCashiers; // an array of regular cashiers

   int numExpressCashiers, numRegularCashiers;
   Cashier* getBestCashier(typeCashier ctype);
   // auxiliary to sendCustomertoCashier,choose cashier of given type
   // that has shorter queue 

public:

   // Constructor: build a CashierStand with nExpress express cashiers
   // and  nRegular regular cashiers and make all of
   // them available.
   CashierStand (int nExpress, int nRegular);
   ~CashierStand() { delete [] expressCashiers; delete [] regularCashiers; }

   // getNumberOfExpressCashiers: return the number of express cashiers.
   // (This method is needed when statistics are gathered.)
   int getNumberOfExpressCashiers() const { return numExpressCashiers; }

   // getNumberOfRegularCashiers: return the number of regular cashiers.
   // (This method is needed when statistics are gathered.)
   int getNumberOfRegularCashiers() const { return numRegularCashiers; }

   // sendCustomerToCashier: send customer to cashier, or put it in queue.
   void sendCustomerToCashier (Cust *arrivingCust);
};

#endif
