Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

SynchConsoleInput Class Reference

The following class defines synchronized input to a console device. More...

#include <synchconsole.h>

Inheritance diagram for SynchConsoleInput::

CallBackObj List of all members.

Public Methods

 SynchConsoleInput (char *inputFile)
 Initialize the console device. More...

 ~SynchConsoleInput ()
 Deallocate console device. More...

char GetChar ()
 Read a character, waiting if necessary. More...


Private Methods

void CallBack ()
 called when a keystroke is available. More...


Private Attributes

ConsoleInputconsoleInput
 the hardware keyboard. More...

Locklock
 only one reader at a time. More...

SemaphorewaitFor
 wait for callBack. More...


Detailed Description

The following class defines synchronized input to a console device.

Definition at line 23 of file synchconsole.h.


Constructor & Destructor Documentation

SynchConsoleInput::SynchConsoleInput ( char * inputFile )
 

Initialize the console device.

SynchConsoleInput::SynchConsoleInput Initialize synchronized access to the keyboard

"inputFile" -- if NULL, use stdin as console device otherwise, read from this file

Definition at line 20 of file synchconsole.cc.

SynchConsoleInput::~SynchConsoleInput ( )
 

Deallocate console device.

SynchConsoleInput::~SynchConsoleInput Deallocate data structures for synchronized access to the keyboard

Definition at line 32 of file synchconsole.cc.


Member Function Documentation

void SynchConsoleInput::CallBack ( ) [private, virtual]
 

called when a keystroke is available.

SynchConsoleInput::CallBack Interrupt handler called when keystroke is hit; wake up anyone waiting.

Reimplemented from CallBackObj.

Definition at line 64 of file synchconsole.cc.

char SynchConsoleInput::GetChar ( )
 

Read a character, waiting if necessary.

SynchConsoleInput::GetChar Read a character typed at the keyboard, waiting if necessary.

Definition at line 45 of file synchconsole.cc.

Referenced by UserProgKernel::SelfTest().


Member Data Documentation

ConsoleInput * SynchConsoleInput::consoleInput [private]
 

the hardware keyboard.

Definition at line 31 of file synchconsole.h.

Lock * SynchConsoleInput::lock [private]
 

only one reader at a time.

Definition at line 32 of file synchconsole.h.

Semaphore * SynchConsoleInput::waitFor [private]
 

wait for callBack.

Definition at line 33 of file synchconsole.h.


The documentation for this class was generated from the following files:
Generated at Wed Jul 4 11:32:24 2001 for Nachos by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001