📄 messages.h
字号:
#ifndef MESSAGES_H#define MESSAGES_H#include <algae/config.h>#include <string>#include <iostream>#include <algae/algae.h>//// Messages provides the interface for messages sent// from the server (algorithm) between the AlgAE client// (the graphic display).// class Messages {private: Messages(): in(CIN), out(COUT) {} Messages (const Messages& ): in(CIN), out(COUT) {} void operator= (const Messages&) {}public: Messages (std::istream& inputs, std::ostream& outputs); // Inputs from the client // [These may block until the client actually sends a signal. They may // also terminate the program if the client shuts down unexpectedly.] bool canContinue(); bool clientIsPausing() const; std::string getMenuSelection(); std::string promptForInput (const std::string& prompt); std::string stdInput(); // Outputs to the client void beginEdgeList(); void endEdgeList(); void beginComponentList(); void endComponentList(); void touch (int sourceID, int destID, AlgAE::Directions dir, AlgAE::Color color, const std::string& edgeLabel); void node (int objectID, AlgAE::Color color, const std::string& label, bool vertical); void node (int objectID, const std::string& label); void hide (int objectID); void beginAlgorithm(); void endAlgorithm(); void beginFrame(); void endFrame(const std::string& frameIdentifier); void menuItem (const std::string& itemName); void status (const std::string& statusMsg); void algorithmName (const std::string& algName, const std::string& aboutString); void quit(); void message (const std::string& msg); void stdOutput (const std::string& msg);private: std::istream& in; std::ostream& out; bool touchingEdges; bool continuingPermitted; bool pausing; bool getLine(std::string& line); std::string encode (const std::string&); std::string decode (const std::string&); };#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -