RInside Version 0.2.12
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
rinside_callbacks.h
Go to the documentation of this file.
1 class RInsideCallbacks : public Callbacks {
2  public:
3  // see inst/includes/Callbacks.h for a list of all overrideable methods
4  virtual std::string ReadConsole( const char* prompt, bool addtohistory ) {
5  return "";
6  };
7 
8  virtual void WriteConsole( const std::string& line, int type ) {
9  output_buffer << line;
10  //printf("Got buffer of type %d: '%s'\n", type, line.c_str());
11  };
12 
13  virtual void FlushConsole() {
14  };
15 
16  virtual void ResetConsole() {
17  };
18 
19  virtual void CleanerrConsole() {
20  };
21 
22  virtual void Busy( bool /*is_busy*/ ) {
23  };
24 
25  virtual void ShowMessage(const char* message) {
26  //printf("Got Message: '%s'\n", message);
27  };
28 
29  virtual void Suicide(const char* message) {
30  LOG("R Suicide: %s", message);
31  throw std::runtime_error("R suicided"); // TODO: is this the correct way to handle suicides?
32  };
33 
34 
35  virtual bool has_ReadConsole() { return true; };
36  virtual bool has_WriteConsole() { return true; };
37  virtual bool has_FlushConsole(){ return true; };
38  virtual bool has_ResetConsole() { return true; };
39  virtual bool has_CleanerrConsole() { return true; };
40  virtual bool has_Busy() { return true; };
41  virtual bool has_ShowMessage() { return true; };
42  virtual bool has_Suicide() { return true; };
43 
45  output_buffer.str("");
46  output_buffer.clear();
47  }
48 
49  std::string getConsoleOutput() {
50  return output_buffer.str();
51  }
52  private:
53  std::ostringstream output_buffer;
54 };
virtual void Suicide(const char *message)
std::string getConsoleOutput()
virtual std::string ReadConsole(const char *prompt, bool addtohistory)
std::ostringstream output_buffer
virtual void ShowMessage(const char *message)
virtual bool has_ResetConsole()
virtual bool has_ShowMessage()
virtual void WriteConsole(const std::string &line, int type)
virtual bool has_Suicide()
virtual void ResetConsole()
virtual bool has_Busy()
virtual bool has_ReadConsole()
virtual bool has_CleanerrConsole()
virtual void Busy(bool)
virtual void CleanerrConsole()
virtual bool has_FlushConsole()
#define LOG(...)
virtual void FlushConsole()
virtual bool has_WriteConsole()