UMPS
The University of Utah Seismograph Stations Message Passing System.
process.hpp
1 #ifndef UMPS_MODULES_PROCESS_HPP
2 #define UMPS_MODULES_PROCESS_HPP
3 #include <functional>
4 #include <memory>
5 namespace UMPS::Modules
6 {
12 class IProcess
13 {
14 public:
17 
19  [[nodiscard]] virtual std::string getName() const noexcept;
22  virtual void operator()();
24  virtual void start() = 0;
26  virtual void stop() = 0;
28  [[nodiscard]] virtual bool isRunning() const noexcept = 0;
29 
31  void setStopCallback(const std::function<void ()> &callback);
36 
38  virtual ~IProcess();
39 private:
40  class IProcessImpl;
41  std::unique_ptr<IProcessImpl> pImpl;
42 };
43 }
44 #endif
A module is typically comprised of multiple processes. This defines the essential qualities that cons...
Definition: process.hpp:13
virtual bool isRunning() const noexcept=0
virtual std::string getName() const noexcept
IProcess()
Constructor.
virtual void start()=0
Starts the process.
void issueStopCommand()
Issues the stop command by calling the callback.
virtual void stop()=0
Stops the process.
void setStopCallback(const std::function< void()> &callback)
Sets the stop callback if this process needs to stop the program.