CEBL  2.1
Public Member Functions
CEBL::RController Class Reference

#include <RController.hpp>

Public Member Functions

 RController ()
 ~RController ()
bool start ()
void stop ()
bool isConnected ()
void sendCommand (string command, bool clear=true)
string getResponse ()
ublas::matrix< double > readMatrixFromTempFile ()
void writeMatrixToTempFile (ublas::matrix< double > mat)

Detailed Description

Definition at line 32 of file RController.hpp.


Constructor & Destructor Documentation

RController::RController ( )

Definition at line 17 of file RController.cpp.

RController::~RController ( )

Definition at line 27 of file RController.cpp.


Member Function Documentation

string RController::getResponse ( )

Get a raw response from the R process. This function will block until R prompt has been encountered from standard output.

Returns:

Definition at line 195 of file RController.cpp.

Referenced by main().

bool CEBL::RController::isConnected ( )
inline

Check if we are connected to R

 \return 

Definition at line 70 of file RController.hpp.

ublas::matrix< double > RController::readMatrixFromTempFile ( )

Reads matrix written to tempfile. Use f token in sendCommand to send temporary filename to R.

Returns:

Definition at line 271 of file RController.cpp.

void RController::sendCommand ( string  command,
bool  clear = true 
)

Sends a command to R. This function will not block. Since we are using pipes, there's no way of knowing when R finishes processing a command.

NOTES:command can contain a few token that will be replaced before sending to R:

f - generate a temporary filename

Parameters:
commandR command

Definition at line 173 of file RController.cpp.

Referenced by main().

bool RController::start ( )

Starts R process and connects pipes Returns success.

Returns:
success

Definition at line 117 of file RController.cpp.

Referenced by main().

void RController::stop ( )

Attempt to close R process

Definition at line 131 of file RController.cpp.

Referenced by main().

void RController::writeMatrixToTempFile ( ublas::matrix< double >  mat)

Writes a matrix to a file which can later be read by R using f token in sendCommand.

Parameters:
mat

Definition at line 276 of file RController.cpp.

References cppR::writeTable().

Referenced by main().


The documentation for this class was generated from the following files: