class
RMonitorSingleton class for tracking threads and safe communication.
Public static functions
Constructors, destructors, conversion operators
Public functions
Protected functions
- auto calledFromMainThread() -> bool
- returns
true
only when called from main thread. - void safelycheckUserInterrupt()
- checks for user interruptions, but only if called from main thread.
- auto safelyIsInterrupted() -> bool
-
template<class T>void safelyPrint(const T& object)
-
template<class T>void safelyPrintErr(const T& object)
Friends
- void checkUserInterrupt(bool condition)
- auto isInterrupted(bool condition) -> bool
Function documentation
bool RcppThread:: RMonitor:: safelyIsInterrupted() protected
checks for user interruptions, but only if called from main thread (otherwise last known state is returned).
template<class T>
void RcppThread:: RMonitor:: safelyPrint(const T& object) protected
Parameters | |
---|---|
object | a string or coercible object to print. |
prints object
to R console íf called from main thread; otherwise adds a printable version of object
to a buffer for deferred printing.
template<class T>
void RcppThread:: RMonitor:: safelyPrintErr(const T& object) protected
Parameters | |
---|---|
object | a string or coercible object to print. |
prints object
to R error stream íf called from main thread; otherwise adds a printable version of object
to a buffer for deferred printing.
void checkUserInterrupt(bool condition)
Parameters | |
---|---|
condition | optional; a condition for the check to be executed. |
checks for user interruptions, but only if called from main thread.
Declared as a friend in RMonitor
.
bool isInterrupted(bool condition)
Parameters | |
---|---|
condition | optional; a condition for the check to be executed. |
checks for user interruptions, but only if called from main thread (otherwise returns false
).
Declared as a friend in RMonitor
.