observer.h From Astrachan, p. 326 ---------------------------------- #ifndef _OBSERVER_H #define _OBSERVER_H // a class for observing a one-dimensional random walk // this version records the events of the walk in // a text file whose name is specified in a parameter to // the constructor // // WalkObserver(const string & filename)-- observer records output // in the text file "filename" // // void Update(int step, int position) -- called by a walking object // to observe (record) the walk class WalkObserver { public: WalkObserver(const string & filename); // specify filename void Update(int step, int position); // update information from walker private: ofstream myOutputStream; // output stream for data }; #endif