RStudio Launcher Plugin SDK  1.1.3
A software development kit for creating plugins that work the the RStudio Launcher.
Public Member Functions | List of all members
rstudio::launcher_plugins::system::AsioStream Class Referencefinal

Class which allows reading from or writing to streams asynchronously. More...

#include <Asio.hpp>

Public Member Functions

 AsioStream (int in_streamHandle)
 Constructor. More...
 
 ~AsioStream () noexcept
 Destructor. Closes the stream.
 
void close () noexcept
 Closes the stream. Nothing may be read from or written to the stream after this is called.
 
void readBytes (const OnReadBytes &in_onReadBytes, const OnError &in_onError)
 Attempts to read bytes from this ASIO stream. More...
 
void writeBytes (const std::string &in_data, const OnError &in_onError, const AsioFunction &in_onFinishedWriting=AsioFunction())
 Writes the provided data to the stream asynchronously. More...
 

Detailed Description

Class which allows reading from or writing to streams asynchronously.

Constructor & Destructor Documentation

◆ AsioStream()

rstudio::launcher_plugins::system::AsioStream::AsioStream ( int  in_streamHandle)
explicit

Constructor.

Parameters
in_streamHandleThe handle of the stream for which to create this ASIO stream descriptor.

Member Function Documentation

◆ readBytes()

void rstudio::launcher_plugins::system::AsioStream::readBytes ( const OnReadBytes &  in_onReadBytes,
const OnError in_onError 
)

Attempts to read bytes from this ASIO stream.

Parameters
in_onReadBytesCallback function which will be invoked on successful read.
in_onErrorCallback function which will be invoked if an error occurs.

◆ writeBytes()

void rstudio::launcher_plugins::system::AsioStream::writeBytes ( const std::string &  in_data,
const OnError in_onError,
const AsioFunction &  in_onFinishedWriting = AsioFunction() 
)

Writes the provided data to the stream asynchronously.

This method is thread safe. Each provided block of data will be written to the stream in full before a new one begins.


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