Source of ListingC1-05.h


  1: //  Created by Frank M. Carrano and Timothy M. Henry.
  2: //  Copyright (c) 2017 Pearson Education, Hoboken, New Jersey.

  4: /** Listing C1-5.
  5:     @file ToyBox.h */

  7: #ifndef TOY_BOX_
  8: #define TOY_BOX_
  9: #include "PlainBox.h"

 11: enum Color {BLACK, RED, BLUE, GREEN, YELLOW, WHITE};

 13: template<class ItemType>
 14: class ToyBox : public PlainBox<ItemType>
 15: {
 16: private:
 17:    Color boxColor;
 18: public:
 19:    ToyBox();
 20:    ToyBox(const Color& theColor);
 21:    ToyBox(const ItemType& theItem, const Color& theColor);
 22:    Color getColor() const;
 23: }; // end ToyBox
 24: #include "ToyBox.cpp"
 25: #endif