1 #ifndef TELEPHONE_H
2 #define TELEPHONE_H
3
4 using namespace std;
5
6 #include <iostream>
7 #include <string>
8
9 class Connection;
10
11 /**
12 A telephone that takes simulated keystrokes and voice input
13 from the user and simulates spoken text.
14 */
15 class Telephone
16 {
17 public:
18 /**
19 Speak a message to standard output
20 @param output the text that will be spoken
21 */
22 void speak(string output);
23
24 /**
25 Loops reading user input and passes the input
26 to the Connection object's functions dial, record,
27 or hangup.
28 @param c the connection that connects this phone
29 to the voice mail system
30 */
31 void run(Connection& c);
32 };
33
34 inline void Telephone::speak(string output)
35 {
36 cout << output;
37 }
38
39 #endif