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

A module executed on a timer. More...

#include <scriptModules.hpp>

Public Member Functions

 TimedModule ()=default
 Default constructor.
 TimedModule (const std::chrono::duration< uint32_t > &executionInterval, std::shared_ptr< std::condition_variable > stopSignal, std::shared_ptr< std::mutex > mutex, 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.
 TimedModule (TimedModule &&toMove) noexcept=default
 Move constructor.
TimedModuleoperator= (TimedModule &&toMove) noexcept=default
 Move assignment operator.
 ~TimedModule ()=default
 Destructor.
void operator() () const

Detailed Description

A module executed on a timer.

Executes a shell script on a timer.

Constructor & Destructor Documentation

◆ TimedModule() [1/2]

PSSspace::TimedModule::TimedModule ( const std::chrono::duration< uint32_t > & executionInterval,
std::shared_ptr< std::condition_variable > stopSignal,
std::shared_ptr< std::mutex > mutex,
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]executionIntervalrefresh interval
[in]stopSignalcondition variable the spawning thread notifies to stop the loop
[in]mutexmutex shared with the spawning thread; guards stop, outputTarget, and the stop wait
[in]stopflag shared with the spawning thread; set to true before notifying stopSignal 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

◆ TimedModule() [2/2]

PSSspace::TimedModule::TimedModule ( TimedModule && toMove)
defaultnoexcept

Move constructor.

Parameters
[in]toMoveobject to move

Member Function Documentation

◆ operator()()

void PSSspace::TimedModule::operator() ( ) const

Run the module

Runs the module, refreshing at the specified interval.

◆ operator=()

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

Move assignment operator.

Parameters
[in]toMoveobject to move
Returns
TimedModule object

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