home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
IDIOMS.ZIP
/
4-2.C
< prev
next >
Wrap
C/C++ Source or Header
|
1991-12-04
|
1KB
|
54 lines
/* Copyright (c) 1992 by AT&T Bell Laboratories. */
/* Advanced C++ Programming Styles and Idioms */
/* James O. Coplien */
/* All rights reserved. */
enum Bool {true, false} ;
class Telephone {
public:
void ring();
Bool isOnHook();
Bool isTalking();
Bool isDialing();
DigitString collectDigits();
LineNumber extension();
~Telephone();
protected:
LineNumber extensionData;
Telephone();
};
// POTS is Plain Ordinary Telephone Service
class POTSPhone: public Telephone {
public:
Bool runDiagnostics();
POTSPhone();
POTSPhone(POTSPhone&);
~POTSPhone();
private:
// these are details of the phone's wiring
// connections in the telephone office
Frame frameNumberVal;
Rack rackNumberVal;
Pair pairVal;
};
// ISDN is Integrated Services Digital Network
class ISDNPhone: public Telephone {
public:
ISDNPhone();
ISDNPhone(ISDNPhone&);
~ISDNPhone();
void sendBPacket();
void sendDPacket();
private:
Channel b1, b2, d;
};
class PrincessPhone: public POTSPhone {
. . . .
};