astream.h

来自「ALGAE是一个快速创建算法演示的框架。目前支持的算法实现语言包括java和c」· C头文件 代码 · 共 61 行

H
61
字号
#ifndef ALGAE_STREAM_H#define ALGAE_STREAM_H#include <algae/config.h>#include <iostream>////  The AlgAEStreamBuffer is used to divert C++ std I/O//  from the algorithm code to/from the AlgAE client.//class AlgAEStreamBuffer: public std::streambuf{public:  AlgAEStreamBuffer (int bufferSize, bool forInput);  ~AlgAEStreamBuffer ();  virtual int sync ();  virtual int overflow (int ch);  virtual int underflow();private:  char* buffer;  int bufSize;};//// A replacement for standard output from the algorithm code,// this class sends output to the AlgAE client, where it appears// in the stdIO window.//class AlgAEostream: public std::ostream{public:  AlgAEostream ();  ~AlgAEostream ();};//// A replacement for standard input for the algorithm code,// this class get input from the AlgAE client, where it has been// typed into the stdIO window.//class AlgAEistream: public std::istream{public:  AlgAEistream ();  ~AlgAEistream ();};class AlgAEstdioStreams{public:  static AlgAEostream aout;  static AlgAEistream ain;};#endif

⌨️ 快捷键说明

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