Source of ListingC1-04.cpp


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

  4: /** Listing C1-4
  5:     @file PlainBox.cpp */
  6:     
  7: #include "PlainBox.h"

  9: template<class ItemType>
 10: PlainBox<ItemType>::PlainBox()
 11: {
 12: }  // end default constructor

 14: template<class ItemType>
 15: PlainBox<ItemType>::PlainBox(const ItemType& theItem) : item(theItem)
 16: {
 17: }  // end constructor

 19: template<class ItemType>
 20: void PlainBox<ItemType>::setItem(const ItemType& theItem)
 21: {
 22:    item = theItem;
 23: }  // end setItem

 25: template<class ItemType>
 26: ItemType PlainBox<ItemType>::getItem() const
 27: {
 28:    return item;
 29: }  // end getItem