1: //MemoryCell.cpp
3: #include "MemoryCell.h"
5: //Construct the MemoryCell with initialValue.
6: template <class Object>
7: MemoryCell<Object>::MemoryCell(const Object& initialValue)
8: :storedValue(initialValue)
9: {
10: }
13: //Return the stored value.
14: template <class Object>
15: const Object& MemoryCell<Object>::read() const
16: {
17: return storedValue;
18: }
21: //Store x.
22: template <class Object>
23: void MemoryCell<Object>::write(const Object& x)
24: {
25: storedValue = x;
26: }