// pstand.h: the PumpStand class, representing the complete collection of // pumps at the gas station. class PumpStand { private: Pump ** pumps; // an array of pointers to pumps int numPumps; int topPump; public: // Constructor: build a PumpStand of numPumps pumps, and make all of // them available. PumpStand (int n); // aPumpIsAvailable: return true/false according to whether at least one // pump is free for use. int aPumpIsAvailable () { return topPump >= 0; } // getNumberOfPumps: return the number of pumps in the pump stand. // (This method is needed when statistics are gathered.) int getNumberOfPumps () { return numPumps; } // releasePump: put pump p back in the stock of available pumps. void releasePump (Pump *p); // takeAvailablePump: take a pump from the set of free pumps, and return that pump. Pump *takeAvailablePump (); };