messages.h
来自「ALGAE是一个快速创建算法演示的框架。目前支持的算法实现语言包括java和c」· C头文件 代码 · 共 83 行
H
83 行
#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 + =
减小字号Ctrl + -
显示快捷键?