Initial commit
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
IntCell.cpp - IntCell class implementation (Fig 1.8)
|
||||
|
||||
#include "IntCell.h"
|
||||
|
||||
/**
|
||||
* Construct the IntCell with initialValue
|
||||
*/
|
||||
|
||||
IntCell::IntCell( int initialValue ) : storedValue( initialValue )
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the stored value.
|
||||
*/
|
||||
int IntCell::read( ) const
|
||||
{
|
||||
return storedValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Store x.
|
||||
*/
|
||||
void IntCell::write( int x )
|
||||
{
|
||||
storedValue = x;
|
||||
}
|
||||
Reference in New Issue
Block a user