Source of PlainBox.h


  1: //  Created by Frank M. Carrano and Tim Henry.
  2: //  Copyright (c) 2013 __Pearson Education__. All rights reserved.

  4: /** Listing C2-4
  5:  @file PlainBox.h */
  6:     
  7: #ifndef _PLAIN_BOX
  8: #define _PLAIN_BOX

 10: template<class ItemType>  // Indicates this is a template
 11:                           // Declaration for the class PlainBox
 12: class PlainBox
 13: {
 14: private:
 15:    // Data field
 16:    ItemType item;
 17:    
 18: public:
 19:    // Default constructor
 20:    PlainBox();
 21:    
 22:    // Parameterized constructor
 23:    PlainBox(const ItemType& theItem);
 24:    
 25:    // Mutator method that can change the value of the data field
 26:    virtual void setItem(const ItemType& theItem);
 27:    
 28:    // Accessor method to get the value of the data field
 29:    virtual ItemType getItem() const;
 30: }; // end PlainBox

 32: #include "PlainBox.cpp" // Include the implementation file
 33: #endif