A module executed on a signal.
More...
#include <scriptModules.hpp>
|
|
| 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.
|
| SignalModule & | operator= (SignalModule &&toMove) noexcept=default |
| | Move assignment operator.
|
|
| ~SignalModule ()=default |
| | Destructor.
|
| void | operator() () const |
A module executed on a signal.
Executes a shell script on receiving a signal from the main thread.
◆ 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] | signalToExecute | condition variable the spawning thread notifies to trigger execution or stop |
| [in] | mutex | mutex shared with the spawning thread; guards execute, stop, and outputTarget |
| [in] | execute | flag shared with the spawning thread; set to true before notifying signalToExecute to trigger a run |
| [in] | stop | flag shared with the spawning thread; set to true before notifying signalToExecute to terminate |
| [in] | signalOnChange | condition variable to notify the spawning thread that an execution happened |
| [in] | script | path to the shell script |
| [in] | outputLengthLimit | limit on output length, in UTF-8 codepoints (characters) |
| [in] | outputTarget | pointer to the target string |
◆ SignalModule() [2/2]
| PSSspace::SignalModule::SignalModule |
( |
SignalModule && | toMove | ) |
|
|
defaultnoexcept |
Move constructor.
- Parameters
-
◆ operator()()
| void PSSspace::SignalModule::operator() |
( |
| ) |
const |
Run the module
Runs the module, refreshing at the specified interval.
◆ operator=()
Move assignment operator.
- Parameters
-
- Returns
- SignalModule object
The documentation for this class was generated from the following file: