📄 synchconsole.h
字号:
// synchconsole.h // Data structures for synchronized access to the keyboard// and console display devices.//// NOTE: this abstraction is not completely implemented.//// Copyright (c) 1992-1996 The Regents of the University of California.// All rights reserved. See copyright.h for copyright notice and limitation // of liability and disclaimer of warranty provisions.#ifndef SYNCHCONSOLE_H#define SYNCHCONSOLE_H#include "copyright.h"#include "utility.h"#include "callback.h"#include "console.h"#include "synch.h"// The following two classes define synchronized input and output to// a console deviceclass SynchConsoleInput : public CallBackObj { public: SynchConsoleInput(char *inputFile); // Initialize the console device ~SynchConsoleInput(); // Deallocate console device char GetChar(); // Read a character, waiting if necessary private: ConsoleInput *consoleInput; // the hardware keyboard Lock *lock; // only one reader at a time Semaphore *waitFor; // wait for callBack void CallBack(); // called when a keystroke is available};class SynchConsoleOutput : public CallBackObj { public: SynchConsoleOutput(char *outputFile); // Initialize the console device ~SynchConsoleOutput(); void PutChar(char ch); // Write a character, waiting if necessary private: ConsoleOutput *consoleOutput;// the hardware display Lock *lock; // only one writer at a time Semaphore *waitFor; // wait for callBack void CallBack(); // called when more data can be written};#endif // SYNCHCONSOLE_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -