⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 algae.h~

📁 ALGAE是一个快速创建算法演示的框架。目前支持的算法实现语言包括java和c
💻 H~
字号:
#ifndef ALGAE_H#define ALGAE_H#include <algae/config.h>#include <string>#include <iostream>#define String STD string#define IStream STD istream#define OStream STD ostream// Data type for functions to be invoked when the// client signals a menu selection.  typedef void (*menuFunction) ();struct AlgAEMenuItem;class Messages;class Visible;class AlgAE{public:  struct Color  {    unsigned char red;    unsigned char green;    unsigned char blue;  };      static const Color Black;  static const Color White;  static const Color Blue;  static const Color Cyan;  static const Color Green;  static const Color Magenta;  static const Color Red;  static const Color Yellow;  static const Color PaleBlue;  static const Color PaleCyan;  static const Color PaleGreen;  static const Color PaleMagenta;  static const Color PaleRed;  static const Color PaleYellow;  static const Color DarkGray;  static const Color MedGray;  enum Directions {N, NNE, NE, ENE,         E, ESE, SE, SSE,         S, SSW, SW, WSW,         W, WNW, NW, NNW,         AnyDir};  //****************************************************  // Constructor for AlgAE server.  Parameters are command line  // arguments passed to main(nargs, args).  AlgAE (int nargs, char** args);  ~AlgAE ();  // Declare a menu item to appear in the client's Algorithm menu  // and a corresponding function to be executed here on the server  // in response to a selection of that item.  void menuItem (const String& menuItemTitle,		 menuFunction theOperation);  // Start the client and begin running the animation server.  void run(const String& animationTitle, const String& aboutString);    // Signal that a frame should be drawn, and the algorithm paused  // until the client gives a "continue" signal.  void FRAME (const String& frameIdentifier, const String& message);  void FRAME (const String& message) {FRAME (message, message);}  void FRAME (const char* frameIdentifier, const char* message);  void FRAME (const char* message);  // Pop up a dialog box requesting some input from the person operating  // the client.  void promptForInput (const String& prompt,		       String& response);  // Pop up a dialog box presenting some message to the person operating  // the client.  void message (const String& msg);private:  AlgAE () {}  AlgAE (const AlgAE&) {}  void operator= (const AlgAE&) {}  void error (const String& msg) const;  void addVisibleObject (const Visible*);  void removeVisibleObject (const Visible*);    void showObject (const Visible*);  void hideObject (const Visible*);  void hideObjectsSince (const Visible*);    void describeData();  void enqueue (const Visible*);  void unHighlightAll();    Messages* msgs;  AlgAEMenuItem* algorithmsMenu;    IStream * instream;  OStream * outstream;  OStream * dbgstream;  int socketNum;    friend class AlgAEStreamBuffer;  friend class Messages;  friend class Visible;  struct FrameState;  FrameState* frame;  };extern AlgAE* algae;#undef String#undef IStream#undef OStream// Redefine cin and cout so that standard I/O is directed to the ALGAE client.#ifdef __bad_rdbuf__//  Take the cheap way out if the library does not support//  reassigning the stream buffers using the ios::rdbuf(streambuf&) operator.#include <algae/astream.h>#define cout AlgAEstdioStreams::aout#define cin AlgAEstdioStreams::ain#define COUT cout#define CIN cin#else#define COUT STD cout#define CIN STD cin#endif#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -