RStudio Launcher Plugin SDK  1.1.3
A software development kit for creating plugins that work the the RStudio Launcher.
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
rstudio::launcher_plugins::api::AbstractOutputStream Class Referenceabstract

Streams job output data to the launcher. More...

#include <AbstractOutputStream.hpp>

Inheritance diagram for rstudio::launcher_plugins::api::AbstractOutputStream:

Public Types

typedef std::function< void(uint64_t)> OnComplete
typedef std::function< void(const Error &)> OnError
typedef std::function< void(const std::string &, OutputType, uint64_t)> OnOutput

Public Member Functions

virtual ~AbstractOutputStream ()=default
 Virtual destructor for inheritance.
virtual Error start ()=0
 Starts the output stream. More...
virtual void stop ()=0
 Stops the output stream.

Protected Member Functions

 AbstractOutputStream (OutputType in_outputType, JobPtr in_job, OnOutput in_onOutput, OnComplete in_onComplete, OnError in_onError)
 Constructor. More...
void reportData (const std::string &in_data, OutputType in_outputType)
 Reports output to the launcher. More...
void reportError (const Error &in_error)
 Reports an error to the launcher. More...
void setStreamComplete ()
 Notifies the base class that the output stream has completed (i.e. all output of the specified type has been reported).

Protected Attributes

OutputType m_outputType
JobPtr m_job

Detailed Description

Streams job output data to the launcher.

Member Typedef Documentation

◆ OnComplete

Definitions for callback functions which will be invoked when certain events occur.

Constructor & Destructor Documentation

◆ AbstractOutputStream()

rstudio::launcher_plugins::api::AbstractOutputStream::AbstractOutputStream ( OutputType  in_outputType,
JobPtr  in_job,
OnOutput  in_onOutput,
OnComplete  in_onComplete,
OnError  in_onError 


in_requestIdThe ID of the request for which job output should be streamed.
in_outputTypeThe type of job output to stream.
in_onOutputCallback function which will be invoked when data is reported.
in_onCompleteCallback function which will be invoked when the stream is complete.
in_onErrorCallback function which will be invoked if an error occurs.
in_jobThe job for which output should be streamed.

Member Function Documentation

◆ reportData()

void rstudio::launcher_plugins::api::AbstractOutputStream::reportData ( const std::string &  in_data,
OutputType  in_outputType 

Reports output to the launcher.

in_dataThe output data.
in_outputTypeThe type of output data.

◆ reportError()

void rstudio::launcher_plugins::api::AbstractOutputStream::reportError ( const Error in_error)

Reports an error to the launcher.

in_errorThe error which occurred.

◆ start()

virtual Error rstudio::launcher_plugins::api::AbstractOutputStream::start ( )
pure virtual

Starts the output stream.

Success if the stream could be started; Error otherwise.

Implemented in rstudio::launcher_plugins::api::FileOutputStream.

Member Data Documentation

◆ m_job

JobPtr rstudio::launcher_plugins::api::AbstractOutputStream::m_job

The job for which output should be streamed.

◆ m_outputType

OutputType rstudio::launcher_plugins::api::AbstractOutputStream::m_outputType

The type of output that should be streamed.

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