RInside Version 0.2.16
|
#include <rinsideclient.h>
Public Member Functions | |
RInsideClient (BinaryStream &stream) | |
~RInsideClient () | |
void | parseEvalQ (const std::string &code) |
template<typename T > | |
T | parseEval (const std::string &code) |
template<typename T > | |
void | setValue (const std::string &name, const T &value) |
template<typename T > | |
T | getValue (const std::string &name) |
template<typename R , typename... Params> | |
void | setCallback (const std::string &name, std::function< R(Params...)> &callback) |
std::string | getConsoleOutput () |
void | initPlot (uint32_t width=800, uint32_t height=600) |
std::string | getPlot () |
Private Member Functions | |
void | runScript (const std::string code, int32_t result_typeid) |
void | writeCommand (char command) |
char | readReply (bool accept_ok=true, bool accept_value=false) |
void | unrecoverable_error (const std::string &error) |
Private Attributes | |
BinaryStream | stream |
uint32_t | next_callback_id |
std::map< uint32_t, std::function< void(void)> > | callbacks |
bool | had_unrecoverable_error |
bool | can_send_command |
Definition at line 19 of file rinsideclient.h.
RInsideClient::RInsideClient | ( | BinaryStream & | stream | ) |
Definition at line 12 of file rinsideclient.cpp.
References can_send_command, RIS_MAGIC_NUMBER, stream, and BinaryStream::write().
RInsideClient::~RInsideClient | ( | ) |
Definition at line 17 of file rinsideclient.cpp.
References can_send_command, had_unrecoverable_error, RIS_CMD_EXIT, stream, and BinaryStream::write().
std::string RInsideClient::getConsoleOutput | ( | ) |
Definition at line 70 of file rinsideclient.cpp.
References can_send_command, BinaryStream::read(), readReply(), RIS_CMD_GETCONSOLE, stream, and writeCommand().
Referenced by setCallback(), and test_console_output().
std::string RInsideClient::getPlot | ( | ) |
Definition at line 87 of file rinsideclient.cpp.
References can_send_command, BinaryStream::read(), readReply(), RIS_CMD_GETPLOT, stream, and writeCommand().
Referenced by setCallback(), and test_plot().
|
inline |
Definition at line 49 of file rinsideclient.h.
References can_send_command, BinaryStream::read(), readReply(), RIS_CMD_GETVALUE, unrecoverable_error(), BinaryStream::write(), and writeCommand().
Referenced by test_multiple(), and test_setting_getting().
void RInsideClient::initPlot | ( | uint32_t | width = 800 , |
uint32_t | height = 600 |
||
) |
Definition at line 79 of file rinsideclient.cpp.
References can_send_command, readReply(), RIS_CMD_INITPLOT, stream, BinaryStream::write(), and writeCommand().
Referenced by setCallback(), and test_plot().
|
inline |
Definition at line 30 of file rinsideclient.h.
References can_send_command, BinaryStream::read(), and runScript().
Referenced by test_callbacks(), and test_setting_getting().
|
inline |
Definition at line 25 of file rinsideclient.h.
References can_send_command, and runScript().
Referenced by test_console_output(), and test_plot().
|
private |
Definition at line 105 of file rinsideclient.cpp.
References can_send_command, BinaryStream::read(), RIS_REPLY_ERROR, RIS_REPLY_OK, RIS_REPLY_VALUE, stream, and unrecoverable_error().
Referenced by getConsoleOutput(), getPlot(), getValue(), initPlot(), setCallback(), and setValue().
|
private |
Definition at line 29 of file rinsideclient.cpp.
References callbacks, can_send_command, had_unrecoverable_error, BinaryStream::read(), RIS_CMD_RUN, RIS_REPLY_CALLBACK, RIS_REPLY_OK, RIS_REPLY_VALUE, stream, unrecoverable_error(), BinaryStream::write(), and writeCommand().
Referenced by parseEval(), parseEvalQ(), and setCallback().
|
inline |
Definition at line 65 of file rinsideclient.h.
References callbacks, can_send_command, getConsoleOutput(), getPlot(), initPlot(), next_callback_id, readReply(), RIS_CMD_SETCALLBACK, runScript(), unrecoverable_error(), BinaryStream::write(), and writeCommand().
Referenced by test_callbacks().
|
inline |
Definition at line 38 of file rinsideclient.h.
References can_send_command, readReply(), RIS_CMD_SETVALUE, BinaryStream::write(), and writeCommand().
Referenced by test_multiple(), and test_setting_getting().
|
private |
Definition at line 120 of file rinsideclient.cpp.
References had_unrecoverable_error.
Referenced by getValue(), readReply(), runScript(), and setCallback().
|
private |
Definition at line 95 of file rinsideclient.cpp.
References can_send_command, had_unrecoverable_error, stream, and BinaryStream::write().
Referenced by getConsoleOutput(), getPlot(), getValue(), initPlot(), runScript(), setCallback(), and setValue().
|
private |
Definition at line 98 of file rinsideclient.h.
Referenced by runScript(), and setCallback().
|
private |
Definition at line 100 of file rinsideclient.h.
Referenced by getConsoleOutput(), getPlot(), getValue(), initPlot(), parseEval(), parseEvalQ(), readReply(), RInsideClient(), runScript(), setCallback(), setValue(), writeCommand(), and ~RInsideClient().
|
private |
Definition at line 99 of file rinsideclient.h.
Referenced by runScript(), unrecoverable_error(), writeCommand(), and ~RInsideClient().
|
private |
Definition at line 97 of file rinsideclient.h.
Referenced by setCallback().
|
private |
Definition at line 96 of file rinsideclient.h.
Referenced by getConsoleOutput(), getPlot(), initPlot(), readReply(), RInsideClient(), runScript(), writeCommand(), and ~RInsideClient().