plasma-show-stdout
A KDE Plasma 6 widget that displays stdout of shell scripts to the panel
Loading...
Searching...
No Matches
PSSspace::SignalModule Class Reference

A module executed on a signal. More...

#include <scriptModules.hpp>

Public Member Functions

 SignalModule ()=default
 Default constructor.
 SignalModule (std::unique_ptr< std::condition_variable > signalToExecute, std::shared_ptr< std::mutex > mutex, std::shared_ptr< bool > execute, std::shared_ptr< bool > stop, std::unique_ptr< std::condition_variable > signalOnChange, const std::filesystem::path &script, const size_t &outputLengthLimit, std::unique_ptr< std::string > &outputTarget)
 Constructor with data.
 SignalModule (SignalModule &&toMove) noexcept=default
 Move constructor.
SignalModuleoperator= (SignalModule &&toMove) noexcept=default
 Move assignment operator.
 ~SignalModule ()=default
 Destructor.
void operator() () const

Detailed Description

A module executed on a signal.

Executes a shell script on receiving a signal from the main thread.

Constructor & Destructor Documentation

◆ SignalModule() [1/2]

PSSspace::SignalModule::SignalModule ( std::unique_ptr< std::condition_variable > signalToExecute,
std::shared_ptr< std::mutex > mutex,
std::shared_ptr< bool > execute,
std::shared_ptr< bool > stop,
std::unique_ptr< std::condition_variable > signalOnChange,
const std::filesystem::path & script,
const size_t & outputLengthLimit,
std::unique_ptr< std::string > & outputTarget )
inline

Constructor with data.

Parameters
[in]signalToExecutecondition variable the spawning thread notifies to trigger execution or stop
[in]mutexmutex shared with the spawning thread; guards execute, stop, and outputTarget
[in]executeflag shared with the spawning thread; set to true before notifying signalToExecute to trigger a run
[in]stopflag shared with the spawning thread; set to true before notifying signalToExecute to terminate
[in]signalOnChangecondition variable to notify the spawning thread that an execution happened
[in]scriptpath to the shell script
[in]outputLengthLimitlimit on output length, in UTF-8 codepoints (characters)
[in]outputTargetpointer to the target string

◆ SignalModule() [2/2]

PSSspace::SignalModule::SignalModule ( SignalModule && toMove)
defaultnoexcept

Move constructor.

Parameters
[in]toMoveobject to move

Member Function Documentation

◆ operator()()

void PSSspace::SignalModule::operator() ( ) const

Run the module

Runs the module, refreshing at the specified interval.

◆ operator=()

SignalModule & PSSspace::SignalModule::operator= ( SignalModule && toMove)
defaultnoexcept

Move assignment operator.

Parameters
[in]toMoveobject to move
Returns
SignalModule object

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